|
| 1 | +<!--- |
| 2 | + Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + or more contributor license agreements. See the NOTICE file |
| 4 | + distributed with this work for additional information |
| 5 | + regarding copyright ownership. The ASF licenses this file |
| 6 | + to you under the Apache License, Version 2.0 (the |
| 7 | + "License"); you may not use this file except in compliance |
| 8 | + with the License. You may obtain a copy of the License at |
| 9 | +
|
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +
|
| 12 | + Unless required by applicable law or agreed to in writing, |
| 13 | + software distributed under the License is distributed on an |
| 14 | + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + KIND, either express or implied. See the License for the |
| 16 | + specific language governing permissions and limitations |
| 17 | + under the License. |
| 18 | +--> |
| 19 | + |
| 20 | +# Bug Triage Guide |
| 21 | + |
| 22 | +This guide describes how we prioritize and triage bugs in the Comet project. The goal is to ensure |
| 23 | +that the most impactful bugs — especially correctness issues that produce wrong results — are |
| 24 | +identified and addressed before less critical issues. |
| 25 | + |
| 26 | +## Priority Labels |
| 27 | + |
| 28 | +Every bug should have exactly one priority label. When filing or triaging a bug, apply the |
| 29 | +appropriate label from the table below. |
| 30 | + |
| 31 | +| Label | Color | Description | Examples | |
| 32 | +| ------------------- | ------ | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------- | |
| 33 | +| `priority:critical` | Red | Data corruption, silent wrong results, security vulnerabilities | Wrong aggregation results, FFI data corruption, incorrect cast output | |
| 34 | +| `priority:high` | Orange | Crashes, panics, segfaults, major functional breakage affecting production workloads | Native engine panic, JVM segfault, NPE on supported code path | |
| 35 | +| `priority:medium` | Yellow | Functional bugs, performance regressions, broken features that have workarounds | Missing expression support, writer feature gaps, excessive spilling | |
| 36 | +| `priority:low` | Green | Minor issues, test-only failures, tooling, CI flakes, cosmetic issues | Flaky CI test, build script edge case, documentation generator bug | |
| 37 | + |
| 38 | +### How to Choose a Priority |
| 39 | + |
| 40 | +Use this decision tree: |
| 41 | + |
| 42 | +1. **Can this bug cause silent wrong results?** If yes → `priority:critical`. These are the most |
| 43 | + dangerous bugs because users may not notice the incorrect output. |
| 44 | +2. **Does this bug crash the JVM or native engine?** If yes → `priority:high`. Crashes are |
| 45 | + disruptive but at least visible to the user. |
| 46 | +3. **Does this bug break a feature or cause significant performance degradation?** If yes → |
| 47 | + `priority:medium`. The user can work around it (e.g., falling back to Spark) but it impacts |
| 48 | + the value of Comet. |
| 49 | +4. **Everything else** → `priority:low`. Test failures, CI issues, tooling, and cosmetic problems. |
| 50 | + |
| 51 | +### Escalation Triggers |
| 52 | + |
| 53 | +A bug should be escalated to a higher priority if: |
| 54 | + |
| 55 | +- A `priority:high` crash is discovered to also produce wrong results silently in some cases → |
| 56 | + escalate to `priority:critical` |
| 57 | +- A `priority:medium` bug is reported by multiple users or affects a common workload → consider |
| 58 | + escalating to `priority:high` |
| 59 | +- A `priority:low` CI flake is blocking PR merges consistently → escalate to `priority:medium` |
| 60 | + |
| 61 | +## Area Labels |
| 62 | + |
| 63 | +Area labels indicate which subsystem is affected. A bug may have multiple area labels. These |
| 64 | +help contributors find bugs in their area of expertise. |
| 65 | + |
| 66 | +| Label | Description | |
| 67 | +| ------------------ | ----------------------------------------- | |
| 68 | +| `area:writer` | Native writer (Parquet and other formats) | |
| 69 | +| `area:shuffle` | Shuffle (JVM and native) | |
| 70 | +| `area:aggregation` | Hash aggregates, aggregate expressions | |
| 71 | +| `area:scan` | Data source scan (Parquet, CSV, Iceberg) | |
| 72 | +| `area:expressions` | Expression evaluation | |
| 73 | +| `area:ffi` | Arrow FFI / JNI boundary | |
| 74 | +| `area:ci` | CI/CD, GitHub Actions, build tooling | |
| 75 | + |
| 76 | +The following pre-existing labels also serve as area indicators: `native_datafusion`, |
| 77 | +`native_iceberg_compat`, `spark 4`, `spark sql tests`. |
| 78 | + |
| 79 | +## Triage Process |
| 80 | + |
| 81 | +Every new issue is automatically labeled with `requires-triage` when it is opened. This makes it |
| 82 | +easy to find issues that have not yet been triaged by filtering on that label. Once an issue has |
| 83 | +been triaged, remove the `requires-triage` label and apply the appropriate priority and area labels. |
| 84 | + |
| 85 | +### For New Issues |
| 86 | + |
| 87 | +When a new bug is filed: |
| 88 | + |
| 89 | +1. **Reproduce or verify** the issue if possible. If the report lacks reproduction steps, ask |
| 90 | + the reporter for more details. |
| 91 | +2. **Assess correctness impact first.** Ask: "Could this produce wrong results silently?" This |
| 92 | + is more important than whether it crashes. |
| 93 | +3. **Apply a priority label** using the decision tree above. |
| 94 | +4. **Apply area labels** to indicate the affected subsystem(s). |
| 95 | +5. **Apply `good first issue`** if the fix is likely straightforward and well-scoped. |
| 96 | +6. **Remove the `requires-triage` label** to indicate triage is complete. |
| 97 | + |
| 98 | +### For Existing Bugs |
| 99 | + |
| 100 | +Periodically review open bugs to ensure priorities are still accurate: |
| 101 | + |
| 102 | +- Has a `priority:medium` bug been open for a long time with user reports? Consider escalating. |
| 103 | +- Has a `priority:high` bug been fixed by a related change? Close it. |
| 104 | +- Are there clusters of related bugs that should be tracked under an EPIC? |
| 105 | + |
| 106 | +### Prioritization Principles |
| 107 | + |
| 108 | +1. **Correctness over crashes.** A bug that silently returns wrong results is worse than one that |
| 109 | + crashes, because crashes are at least visible. |
| 110 | +2. **User-reported over test-only.** A bug hit by a real user on a real workload takes priority |
| 111 | + over one found only in test suites. |
| 112 | +3. **Core path over experimental.** Bugs in the default scan mode (`native_comet`) or widely-used |
| 113 | + expressions take priority over bugs in experimental features like `native_datafusion` or |
| 114 | + `native_iceberg_compat`. |
| 115 | +4. **Production safety over feature completeness.** Fixing a data corruption bug is more important |
| 116 | + than adding support for a new expression. |
| 117 | + |
| 118 | +## Common Bug Categories |
| 119 | + |
| 120 | +### Correctness Bugs (`priority:critical`) |
| 121 | + |
| 122 | +These are bugs where Comet produces different results than Spark without any error or warning. |
| 123 | +Examples include: |
| 124 | + |
| 125 | +- Incorrect cast behavior (e.g., negative zero to string) |
| 126 | +- Aggregate functions ignoring configuration (e.g., `ignoreNulls`) |
| 127 | +- Data corruption in FFI boundary (e.g., boolean arrays with non-zero offset) |
| 128 | +- Type mismatches between partial and final aggregation stages |
| 129 | + |
| 130 | +When fixing correctness bugs, always add a regression test that verifies the output matches Spark. |
| 131 | + |
| 132 | +### Crash Bugs (`priority:high`) |
| 133 | + |
| 134 | +These are bugs where the native engine panics, segfaults, or throws an unhandled exception. |
| 135 | +Common patterns include: |
| 136 | + |
| 137 | +- **All-scalar inputs:** Some expressions assume at least one columnar input and panic when all |
| 138 | + inputs are literals (e.g., when `ConstantFolding` is disabled) |
| 139 | +- **Type mismatches:** Downcasting to the wrong Arrow array type |
| 140 | +- **Memory safety:** FFI boundary issues, unaligned arrays, GlobalRef lifecycle |
| 141 | + |
| 142 | +### Aggregate Planning Bugs |
| 143 | + |
| 144 | +Several bugs relate to how Comet plans hash aggregates across stage boundaries. The key issue is |
| 145 | +that Spark's AQE may materialize a Comet partial aggregate but then run the final aggregate in |
| 146 | +Spark (or vice versa), and the intermediate formats may not be compatible. See the |
| 147 | +[EPIC #2892](https://github.com/apache/datafusion-comet/issues/2892) for the full picture. |
| 148 | + |
| 149 | +### Native Writer Bugs |
| 150 | + |
| 151 | +The native Parquet writer has a cluster of known test failures tracked as individual issues |
| 152 | +(#3417–#3430). These are lower priority since the native writer is still maturing, but they |
| 153 | +should be addressed before the writer is promoted to production-ready status. |
| 154 | + |
| 155 | +## How to Help with Triage |
| 156 | + |
| 157 | +Triage is a valuable contribution that doesn't require writing code. You can help by: |
| 158 | + |
| 159 | +- Reviewing new issues and suggesting a priority label |
| 160 | +- Reproducing reported bugs and adding details |
| 161 | +- Identifying duplicate issues |
| 162 | +- Linking related issues together |
| 163 | +- Testing whether old bugs have been fixed by recent changes |
0 commit comments