Repository navigation
fix: correct cuTile source locations for generated constants - #1385
Conversation
Use captured module spans for source locations and the current function definition for generated types, arrays and wrapper calls. Add regressions using the assertion kernel from NVIDIA#1379 and a helper in another file. Co-authored-by: Melih Elibol <1884921+elibol@users.noreply.github.com> Signed-off-by: Arthur031221 <levi74108520963@gmail.com>
|
@elibol, checking in on this one. Anything else you need from me? |
|
Reviewing this against the frontend portion of #1379 and the separate checklist in #1475. The function-definition fallback is a narrower guarantee than attributing every generated constant to its consuming statement, and that is a reasonable scope for this PR. For acceptance, please tighten the regression around that actual guarantee:
The actual assertion SIGTRAP and reopened GPU-coredump line/frames are a separate backend acceptance test. Passing source-breakpoint or frontend-location tests does not close that portion of #1379; please keep the issue open for it. #1480 owns wrapper signature locations, and #1528 owns the explicit short-circuit expression spans, so these should not become prerequisites for this targeted fix. |
Check the file, definition line, subprogram and caller chain of the generated constants in the assertion kernel and in a nested cross-file helper, in Line and Full, and that the same locations are present in the serialized bytecode. A user literal in the same kernel must keep its own line. An opt-in test checks the cubin line table with nvdisasm and DWARF. Signed-off-by: Arthur031221 <levi74108520963@gmail.com>
|
Tightened the regression in a new commit on top of the reviewed one. The assertion-kernel test now compares file, subprogram with its definition line, line and caller chain of every constant against a fixed set, so an unrelated later line fails. The generated tile size must sit exactly on the definition line of I added With On this commit |
Integrate the v0.5.0 main baseline and run the generated-constant cubin regression in the CPU/assembler CI suite. Preserve the distinct backend trap-attribution scope. Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
|
/ok to test 2794a67 |
|
Updated to Local CUDA 13.3: all 16 debug and six generated-source tests pass, including assembler/GPU/live CUDA-GDB; strict compiler Clippy and formatting pass. Blocker: the new regression fails in CUDA 13.4 CI. The 13.2 lane passes. I assembled identical bytecode with tileiras 13.3.36 and 13.4.92: 13.3 retains helper source lines in Line/Full; 13.4 substitutes generated Failing check: https://github.com/NVIDIA/cuda-rust/actions/runs/40389948453/job/121808098508. I retained the strict regression. This assembler/debug-info compatibility regression needs resolution before declaring the PR green. Actual assertion SIGTRAP/coredump attribution under #1379 remains separate. Release tracking: #1606. |
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
|
/ok to test 933e221 |
@elibol, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
|
/ok to test 933e221 |
|
Updated to The assembler regression still runs in CI. Exact frontend/serialized origins, kernel source presence/ranges, surviving helper ranges and successful assembly remain required. Only the exact Validation: 12 CPU debug tests pass with 13.3 and 13.4; the nested-helper assembler regression passes in Line/Full with 13.2, 13.3 and 13.4.92. A test-only wrapper that changes the 13.4 assembler's reported version makes the same debug loss fail, confirming the exception does not cover future versions. This is not validation of CTK 13.5. Formatting, shell syntax and diff checks pass; self-review completed. Fresh CI is running. This fixes the CI handling, not tileiras itself. The assertion SIGTRAP/GPU-coredump attribution still open in #1379 is not closed by this PR. v0.5.0 scope remains CTK 13.5 or earlier; no dependency on an unreleased CUDA-GDB fix. Tracked in #1606. |
Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
|
/ok to test b25b4fe |
|
Updated to The known-limit handling now covers exactly 13.4.59 and 13.4.92, and the regression prints the actual assembler fingerprint. Unknown versions, including 13.5, keep the full assertions. Frontend/serialized origins, assembly success, kernel locations/ranges, and any surviving helper ranges remain strict. The backend debug-information loss itself is not fixed here. Validation:
Why the other PRs are green: this PR enables |
|
CI is now green at The CUDA 13.4 job ran the nested-helper assembler regression with the actual CI version, 13.4.59. Both Line and Full passed with explicit warnings about the existing backend debug-information loss. CUDA 13.2 passes without that exception. Exact frontend origins remain mandatory; removing the compiler fix still fails all six frontend regression tests. The same test-handling fix is now included in #1613 at |
…1480) Current review head: **`9f19c0c84e32e0b686154695b0f9bd96451b5d1f`**, incorporating main through `0d62b682b` after #1528 and #1600 merged. The diff against main remains four files and one source-policy change: generated entry setup uses the user signature span. Refresh validation: **36 tests passed** on CUDA 13.3 with serial execution: 20 debug-info, three constant-origin, six generated-origin, and seven JIT-override tests. This includes ignored assembler, GPU, and live CUDA-GDB cases. Formatting and diff checks pass. Fresh CI is running; independent review is still needed. The older validation details below are historical evidence, not a claim that every suite was rerun at this head. Generated entry setup currently inherits `Span::call_site()`, so CUDA-GDB attributes the wrapper and its generated assumptions to the module header. Use the original user function's signature span for the synthesized wrapper, including its call into the user kernel. The original kernel body and nested helper locations remain unchanged. The regression checks wrapper operations and assumptions, the outer caller in inline chains, and the serialized entry subprogram's declaration line. Constants compiled from synthesized types are outside this change; #1385 has now merged their separate frontend-origin fix. Backend assertion-trap/coredump attribution remains under #1379. Validation: - The new regression fails with the original wrapper span and passes with this change. - All nine `debug_info` tests pass, including real `tileiras`/`nvdisasm` checks, execution in all debug modes, and the live cuda-gdb cross-file helper test. - Live CUDA-GDB confirms the wrapper frame and the entry instruction now point to the user function signature. - Scoped formatting and `cargo clippy --locked -p cutile-compiler --lib -- -D warnings` pass. - Ran the required `scripts/run_all.sh`: CPU/assembler tests, 26 supported examples, and all eight benchmark smoke tests passed. One example was skipped because it requires Tile IR 13.4 and the installed assembler is 13.3. All GPU targets passed except one existing test-order dependency in `warmup_suite`; the whole 16-test cache suite passes serially on this branch. The script therefore returned nonzero for that unrelated cache test. The unrelated cache failure is reproducible on unchanged base `bafffe45662a5cdc064a1c6674c6c02d466a58e0`: `retain_predicate_may_reenter_the_cache_without_deadlock` leaves the same specialization cached, while `composed_builder_compile_terminal_warms_the_dispatched_specialization` expects its compile count to increase by one. Running the baseline test binary with `RUSTC_BOOTSTRAP=1 <warmup_suite-binary> warmup_composed:: -Z unstable-options --shuffle-seed 3 --test-threads 1` reproduces that assertion. This setting only enables the test harness's shuffle option; it does not rebuild or change the pinned toolchain. For benchmark validation, the existing runner drops its bare `smoke-test` argument. For this run, its invocation was temporarily corrected to `--features smoke-test` so all eight benchmarks used the intended smoke configuration. The runner was restored afterward; that correction is not part of the PR. Part of #1475. The inline call-line breakpoint resolver is addressed separately by [NVIDIA/cuda-gdb#29](NVIDIA/cuda-gdb#29). The generated assertion trap's backend source attribution remains under #1379. Signed-off-by: Melih Elibol <elibol@users.noreply.github.com> Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com> Co-authored-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
Summary
cuTile users compiling with debug info get module-header locations for generated constants and wrapper call sites (#1379). Generated spans were resolved against the module's source base. This addresses the frontend part of #1379. Backend trap attribution remains unverified.
Changes
Resolve captured spans with their owning module and use the containing function definition for generated spans. The regression uses @elibol's assertion kernel from #1379.
Testing
Added line/full and cross-file regressions. From
cutile-rs,cargo +1.98.0 test -p cutile --locked --test debug_infopasses.just -f cuda-oxide/Justfile checkpasses (the local mirror of CI: fmt, clippy, tests, guards, docs)cargo oxide run <example>passes, orcuda-oxide/scripts/smoketest.sh -o '^<example>$'Checklist
git commit -s)Co-authored-by: Melih Elibol 1884921+elibol@users.noreply.github.com