Repository navigation
fix(cutile-compiler): preserve origins of short-circuit, folded and bool-binding constants - #1528
GiGiKoneti wants to merge 2 commits into
Conversation
…pression span Short-circuit boolean operations (`a && b`, `a || b`) generate deciding constants when the left-hand operand decides the outcome. Previously, `compile_bool_constant` created constants from synthesized `bool` type spans, resolving to fallback module-header locations. Pass the logical expression's span through `compile_bool_constant` and the shared constant builder (`compile_constant_from_exact_bounds`), ensuring the resulting constant operation receives the exact expression line while preserving inlined helper scopes and call chains. Add regression test in `debug_info.rs` verifying source line attribution and inline caller provenance for both direct and inlined expressions. Part of NVIDIA#1475. Signed-off-by: GiGiKoneti <gigikoneti@gmail.com>
|
Reviewing this against the short-circuit item assigned in #1475. The new test checks a direct Before considering those sub-items covered:
Please record the focused fail-before/pass-after result. Wrapper locations, arrays, reductions, and injected checks remain separate #1475 work; this PR should not close the entire audit or claim to fix backend assertion traps. |
…nance Integrate current main. Attribute inlined boolean bindings to callee definitions instead of resolving caller coordinates in the callee module. Cover deciding false/true constants, a folded expression on a different line from its operands, and entry/function/method bindings in Line and Full modes with exact serialized inline chains. Signed-off-by: Melih Elibol <1884921+elibol@users.noreply.github.com>
|
/ok to test 64f0ebf |
|
Pushed Fixed a const-bool attribution issue in the proposed change: function/method bindings resolved a caller expression span inside the callee scope. They now use the callee signature, matching const-array bindings. The new CPU CI target checks deciding false/true short-circuit constants, a folded expression on a different line from both operands, and entry/function/method const-bool bindings. It covers Line/Full, cross-file nested callers and exact serialized chains. Regressions fail on the earlier compiler; reverting only the folded-expression span also fails its dedicated test. All three new tests and the existing debug/generated-source suites pass on CUDA 13.3, including assembler/GPU/CUDA-GDB. Strict Clippy for the new target and formatting pass. Combined source-location/debug-mode validation in #1613 passes all 35 tests. Fresh CI is running. This covers the short-circuit/folded-expression/const-bool portion of #1475; tracked in #1606. |
Short-circuit and folded constants can inherit a synthetic type's module-header location or an operand's definition instead of the expression that produces them. Pass the expression span into constant construction so Line and Full debug modes preserve the expression's file, line and nested inline callers.
Const-bool bindings in entries, functions and methods use the corresponding callee signature. Resolving caller coordinates in a callee scope could otherwise attach the binding to the wrong file/line.
The new
constant_source_locationsCPU CI target checks deciding false/true constants, a folded expression on a different line from its operands, and all three binding contexts. It verifies exact cross-file caller chains both in the IR and after bytecode serialization.Validation: all three regressions pass and fail on the earlier compiler; selectively restoring the old folded-expression span fails its dedicated regression. Existing debug/generated-source tests, assembler/GPU/CUDA-GDB checks, formatting and strict Clippy pass on CUDA 13.3. Combined debug validation in #1613 passes all 35 tests. CI and review remain required before merge.
Part of #1475; v0.5.0 tracking: #1606.