Commit 280d4da
Unify All Launch Indices to 0-based (#211)
Summary:
This PR unifies all launch indices across the codebase to use 0-based indexing, making them consistent with Python conventions and the existing 0-based indexing used in the `info` module and `reproduce` command.
## Changes
- **`tritonparse/trace_processor.py`**:
- Changed `(parsed_json, i + 1)` to `(parsed_json, i)` on line 304
- `launch_index_map` now stores 0-based line indices instead of 1-based
- **`website/src/pages/KernelOverview.tsx`**:
- Updated comment from "(1-based line numbers)" to "(0-based line numbers)"
- Display logic unchanged (already displays raw values)
- **`website/src/components/DiffViewer.tsx`**:
- Removed `+ 1` conversion when displaying launch ranges
- Now displays 0-based launch indices directly
- **`website/src/components/StackDiffViewer.tsx`**:
- Removed `+ 1` conversion when displaying launch ranges
- Now displays 0-based launch indices directly
- **`website/src/components/ArgumentViewer.tsx`**:
- Removed `+ 1` conversion when displaying launch ranges
- Now displays 0-based launch indices directly
## Breaking Change
**Website Display**: The website will now display 0-based line numbers and launch indices instead of 1-based. Users viewing launch information will see:
- Line numbers starting from 0 instead of 1
- Launch indices starting from 0 instead of 1
## Rationale
- Consistency with Python conventions (0-based indexing)
- Alignment with existing codebase (`info` module, `reproduce` command already use 0-based)
- Simpler code (no need for +1/-1 conversions)
- Better alignment with internal data structures
## Testing
Existing tests continue to pass. The change affects display format only, not core functionality.
Pull Request resolved: #211
Reviewed By: adamomainz
Differential Revision: D88171144
Pulled By: FindHao
fbshipit-source-id: ae0ae41aff010140510e63fada02aa89c56344961 parent ab34d43 commit 280d4da
File tree
5 files changed
+6
-8
lines changed- tritonparse
- website/src
- components
- pages
5 files changed
+6
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
304 | | - | |
305 | | - | |
| 303 | + | |
306 | 304 | | |
307 | 305 | | |
308 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| |||
0 commit comments