shader: reject arithmetic writes to pending sample registers #269
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/273"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T19:57:59Z.
Change
The straight-line pixel translator now rejects a floating-point arithmetic instruction that writes a VGPR still owned by an outstanding texture sample. An early write could replace the tracked sample component and make a later pre-wait read appear valid. Arithmetic may still write an unrelated destination before the wait or reuse the sampled destination after
s_waitcnt vmcnt(0).This applies to the existing floating-point arithmetic path. #176 tracks source readiness across partial waits, #232 adds integer instructions, and #258 and #270 guard their respective proposed opcodes. None is a prerequisite. The offline pixel shader experiment describes the updated constraint.
Verification
Tested commit
cc19c0b548c3d49d889d78c87937f8b64b4a7067on base7233cecc0efea32e0dba55c3d2e66227b09b8a86. Windows build 26200, Visual Studio 2022 x64, local venv withrequirements-dev.txt.. ./tools/dev.ps1, rancmake --preset devandcmake --build --preset dev --target offscreen_checkin a fresh worktree. Both passed.ctest --preset dev --no-tests=error -R '^pixel_aot_(warp|hardware)$' --output-on-failure. With only the regression test added, both test commands failed at the early overwrite withAssertionError: translate accepted invalid input. With the guard added, both passed. Repeated on the committed head with-V. Microsoft Basic Render Driver 10.0.26100.9818 and NVIDIA GeForce RTX 5080 driver 32.0.16.1692, debug layers unavailable, zero skips.python -B tests/pixel_aot_check.py binary $asm $objcopy $llvmpassed with LLVM 15.0.7. On Windows,$asmis a wrapper invokingclang -cc1as -triple amdgcn--amdpal -target-cpu gfx1013 -filetype obj <source> -o <object>, and the other paths select the correspondingllvm-objcopy.exeandLLVM-C.dll.ctest --preset dev --no-tests=error -R '^docs_links$' --output-on-failurepassed.git diff --check upstream/main HEADpassed.Evidence and follow-up
The regression uses the repository's MIT-licensed synthetic shader. The sample writes
v12:v15. A floor writingv13before the VM wait must be rejected. Moving the write to free registerv24preserves the sampled green export. Moving the original write after the wait exports the arithmetic result. These are offline translation checks. The WARP and hardware draws exercise the accepted desktop fixture suite; native scheduling of an unsynchronized instruction pair was outside the measurement.Checklist
This contribution was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T19:58:08Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
cc19c0bℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.