Repository navigation
shader: trace guarded high words in scalar memory addresses - #79
Merged
Merged
Conversation
AliceWood
marked this pull request as ready for review
November 25, 2026 18:31
simnJS
approved these changes
Nov 25, 2026
simnJS
left a comment
Collaborator
There was a problem hiding this comment.
Thanks. Checked statically: the edge value is used only when only_edge proves a single forward edge the wave takes, and address() still validates it, so nothing is assumed. This can't drop an address that translated before. The hand-encoded words decode as commented, and both negative controls still refuse. CI is green. Approving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
A compute shader writes a table pointer's upper word inside an EXEC guard and reads the pointer after a control-flow join. The path that skips the write cannot supply the pointer to this access. The resource tracer now asks its existing wave-path analysis whether exactly one incoming edge can reach the access. If it can, the tracer follows the value written on that edge and checks it against the address base. An ambiguous guard and a proven but incorrect upper word are both refused.
Fixes the single compute-program high-half case tracked in #56. The broader tracker stays open.
Depends on: none.
Area
xtp-shaderscalar memory address tracking inresource.rsand a synthetic test module.Tests
cargo xtask pr-checkpasses on my machineshader-survey --host-lanes 32-32 --validate --jobs 12with the Windows SDK validator. Gameplay was outside this comparison.458cd45e0ae94dOne compute program gained. Zero translations lost, zero previous translation hashes changed, and all other programs kept their previous outcomes and validation results.
The new synthetic shader reproduced the original refusal on the base commit. On the PR head it translates and passes DXIL validation. Two negative controls check the value assigned on the proven edge and an access that can bypass that assignment. The WARP dispatch expects three active threads to write 19 and a fourth to leave its word untouched.
cargo test --release --locked -p xtp-shader --lib resource::passed all 60 tests. Local WARP reports shader model 6.2 and skipped dispatch. On the GitHub Windows runner the synthetic DXIL validated and the WARP dispatch produced the expected four words. Both tests passed and the log contains neither skip marker. Windows workspace testOn
e0ae94d,cargo xtask pr-check --base origin/mainpassed formatting, both Clippy configurations, asset policy and conventions. The workspace test step stopped atprecook_fills_the_cache_once_for_every_build_of_the_translatorandprecook_keeps_pipelines_across_translation_keys. I rerancargo test --locked -p xtp --test precookon clean458cd45with the same hardware settings and reproduced both failures. This Windows 10 D3D12 runtime reports shader model 6.5 on the RTX 4080, and those tests require 6.6.Provenance
AI assistance: OpenAI Codex wrote the change and hand-encoded synthetic tests for XTP, ran the comparisons, and reviewed the diff. It read the issue and maintainer discussion, the XTP resource tracer, existing XTP shader tests, and the project contribution and shader analysis docs. It used a private local trace to identify the control-flow relationship. The counts in the table were measured independently. No personal human review is claimed.
Checklist
<area>: <summary>, one topic, under 400 changed lines.