Repository navigation
Shaders: reuse SSA sums when tracing memory addresses - #139
Conversation
|
Couldn't find any issues with this. A guess a very long chain of additions could cause a stack overflow |
|
Tested |
…dresses) into the integration Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
catminou4
left a comment
There was a problem hiding this comment.
Merges cleanly with current main (8e79c80); cargo test -p victory-shader --locked → lib tests green, and the new integration suite tests/resource_tracking.rs → 3 passed / 0 failed (1 ignored benchmark) on macOS arm64 / rustc 1.98.1.
The sums cache is sound: it's keyed by SSA value and only filled after the value's operands are settled, and inputs/origin don't change during tracing, so every use of a value sees the same sum — including the opaque fallback, which the comment calls out. The &self → &mut self ripple is mechanical, and phi_site is a clean extraction. The integration tests cover the shared-chain, two-dynamic-terms and offset cases the cache could plausibly break.
Co-Authored-By: GPT 6.2 Sol <noreply@openai.com>
1c5493f to
697c4bc
Compare
Main's tracer is kept; the sums are cached behind a RefCell, so that its shared borrows stay, and dropped when the spilled parameters change them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main reads such an address as title memory instead of refusing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged main in (fast-forward). Main's tracer is unchanged; the sums are cached behind a RefCell and dropped when the spilled parameters change the origins. 999 perf/shader-lane-condition-search : MERGED, CENSUS BEFORE THE PUSHlocal ref: prready/999 (255377d), GitHub head 3ca9456 No push needed (mergeable, no failing check, no open question)prready/1000, 993, 188, 172, 153, 126 = head + main, only to prove that they merge and build: do not push. Worktree: C:\Users\theo_\victory-prs (detached at origin/main). |
|
Automated triage for the maintainers. Merge candidate. Re-checked at CI: Reply to @TG0000: thanks for the merge. The earlier CI failures are gone on this head, as you say. The one-line Generated by Claude Code |
|
Integration note if this lands alongside #1757. On main Adding #1757 ( The current standalone call is correct. This is a one-line adjustment for whichever PR integrates second. AI-assisted; tested locally on Windows MSVC. |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:
- Reusing SSA sums when tracing memory addresses merges cleanly and passes all unit and integration tests.
cargo test -p victory-shader resource::tests: 33/33 passed on RTX 5090 and WARP.cargo test -p victory-shader --test resource_tracking: 3/3 passed (1 benchmark ignored).cargo clippy -p victory-shader --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 184 files ok.
AI-assisted (Gemini 4 Neon).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged main 940d32f in (fast-forward, no conflict). The CI run before was on a machine without a hardware GPU; main skips such shader checks there since 42363ab and ccfb029, and the new run passes. Windows (RX 6800 and WARP, one thread): victory-gpu 143 and victory-shader 247 passed; the portable tests passed on a Mac; clippy Thanks @Dathinel: if #1757 lands first I will make that one-line change here. AI-assisted (Claude Code). |
* Shaders: reuse SSA sums when tracing memory addresses Co-Authored-By: GPT 6.2 Sol <noreply@openai.com> * Shader tests: an address from no root parameter is title memory Main reads such an address as title memory instead of refusing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: GPT 6.2 Sol <noreply@openai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection. Based-on: Marvisak#139 Based-on: Marvisak#244 Based-on: Marvisak#573 Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks Assisted-by: gpt-6.2 sol xhigh
* Shaders: reuse SSA sums when tracing memory addresses Co-Authored-By: GPT 6.2 Sol <noreply@openai.com> * Shader tests: an address from no root parameter is title memory Main reads such an address as title memory instead of refusing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: GPT 6.2 Sol <noreply@openai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection. Based-on: Marvisak#139 Based-on: Marvisak#244 Based-on: Marvisak#573 Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks Assisted-by: gpt-6.2 sol xhigh
* Shaders: reuse SSA sums when tracing memory addresses Co-Authored-By: GPT 6.2 Sol <noreply@openai.com> * Shader tests: an address from no root parameter is title memory Main reads such an address as title memory instead of refusing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: GPT 6.2 Sol <noreply@openai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection. Based-on: Marvisak#139 Based-on: Marvisak#244 Based-on: Marvisak#573 Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks Assisted-by: gpt-6.2 sol xhigh
* Shaders: reuse SSA sums when tracing memory addresses Co-Authored-By: GPT 6.2 Sol <noreply@openai.com> * Shader tests: an address from no root parameter is title memory Main reads such an address as title memory instead of refusing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: GPT 6.2 Sol <noreply@openai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection. Based-on: Marvisak#139 Based-on: Marvisak#244 Based-on: Marvisak#573 Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks Assisted-by: gpt-6.2 sol xhigh
* Shaders: reuse SSA sums when tracing memory addresses Co-Authored-By: GPT 6.2 Sol <noreply@openai.com> * Shader tests: an address from no root parameter is title memory Main reads such an address as title memory instead of refusing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: GPT 6.2 Sol <noreply@openai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection. Based-on: Marvisak#139 Based-on: Marvisak#244 Based-on: Marvisak#573 Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks Assisted-by: gpt-6.2 sol xhigh
* Shaders: reuse SSA sums when tracing memory addresses Co-Authored-By: GPT 6.2 Sol <noreply@openai.com> * Shader tests: an address from no root parameter is title memory Main reads such an address as title memory instead of refusing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: GPT 6.2 Sol <noreply@openai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection. Based-on: Marvisak#139 Based-on: Marvisak#244 Based-on: Marvisak#573 Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks Assisted-by: gpt-6.2 sol xhigh
* Shaders: reuse SSA sums when tracing memory addresses Co-Authored-By: GPT 6.2 Sol <noreply@openai.com> * Shader tests: an address from no root parameter is title memory Main reads such an address as title memory instead of refusing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: GPT 6.2 Sol <noreply@openai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection. Based-on: Marvisak#139 Based-on: Marvisak#244 Based-on: Marvisak#573 Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks Assisted-by: gpt-6.2 sol xhigh
* Shaders: reuse SSA sums when tracing memory addresses Co-Authored-By: GPT 6.2 Sol <noreply@openai.com> * Shader tests: an address from no root parameter is title memory Main reads such an address as title memory instead of refusing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: GPT 6.2 Sol <noreply@openai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection. Based-on: Marvisak#139 Based-on: Marvisak#244 Based-on: Marvisak#573 Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks Assisted-by: gpt-6.2 sol xhigh
* Shaders: reuse SSA sums when tracing memory addresses Co-Authored-By: GPT 6.2 Sol <noreply@openai.com> * Shader tests: an address from no root parameter is title memory Main reads such an address as title memory instead of refusing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: GPT 6.2 Sol <noreply@openai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection. Based-on: Marvisak#139 Based-on: Marvisak#244 Based-on: Marvisak#573 Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks Assisted-by: gpt-6.2 sol xhigh
* Shaders: reuse SSA sums when tracing memory addresses Co-Authored-By: GPT 6.2 Sol <noreply@openai.com> * Shader tests: an address from no root parameter is title memory Main reads such an address as title memory instead of refusing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: GPT 6.2 Sol <noreply@openai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The integration has a different lowering input layout and only permits direct title-address fallback for compute shaders. Exercise that fallback in the same SSA regression and use the available input fields for the permute test. Make the cached sums copyable and close the device creation block after retaining the fork’s adapter selection. Based-on: Marvisak#139 Based-on: Marvisak#244 Based-on: Marvisak#573 Tested-on: Intel Xeon E5-2670 v3, Fedora Linux 45, five shader regressions and Windows-target Cargo checks Assisted-by: gpt-6.2 sol xhigh
Change
Shader resource tracking now caches decomposed address sums by SSA value after copy propagation. Memory accesses and built descriptors can reuse shared additions. Across an unrolled sequence of address increments and loads, this reduces address decomposition from quadratic to linear work.
Synthetic regressions check every address in a shared chain, 32-bit wraparound, preservation of a computed offset, the fallback for sums with two computed terms, and the error for an untraceable base.
Synthetic release benchmark
Windows MSVC on a Ryzen 9 5900X. The benchmark measures the full
resource::trackcall on prebuilt SSA, using the same harness before and after. Times are medians of seven batches.Verification
main. PR #129AI-assisted.