tombox-xshader tests: pin the scratch-segment refusals #262
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!262
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/262/head"
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?
@azerioxfr on GitHub · 2026-11-23 08:24 UTC · original
azerioxfr:xshader-pin-scratch-refusals→main· +28 −0 · 1 files · 1 commits · closed without mergingLibrary / area: tombox-xshader tests, FLAT scratch segment (
hlsl/global.rsemit_global,hlsl.rscode-section load path)Exports changed (exports.txt rows): none
Source of the behaviour: the translator's own refusals. Scratch (thread-private) memory has no binding in the one-lane-per-thread model, so FLAT accesses with SEG=1 are refused. No translator change.
One topic, +28: one test in
tests/synthetic.rs.What was missing
Neither
scratch-memory load unsupportednor{m}: scratch-segment access unsupportedwas named by any test.The test
scratch_segment_flat_loads_and_stores_are_refused, using hand-built FLAT words in compute shaders:flat_load_dword, SEG=2 (global)tb_gload(flat_load_dword, SEG=1 (scratch)scratch-memory load unsupportedflat_store_dword, SEG=2tb_gstore(flat_store_dword, SEG=1flat_store_dword: scratch-segment access unsupportedif ins.aux.mask == 1) set toif falseThe global forms translating shows that the segment is what is refused, not the opcode.
cargo test --locked --release -p tombox-xshader --test synthetic: 25 passed (x86_64-pc-windows-gnu).missingwith a note`emit_global` refuses a FLAT access in the scratch segment, and the code-section load path refuses a scratch load separately (src/hlsl/global.rs: "{m}: scratch-segment access unsupported"; src/hlsl.rs: "scratch-memory load unsupported"). No test exercised either message, so the refusals could be dropped or reworded unnoticed. Add hand-built FLAT words for seg=1 and seg=2 with a scratch load (flat_load_dword) and a scratch store (flat_store_dword), in tests/synthetic.rs. The seg=2 form of each still translates (tb_gload / tb_gstore), so the test shows the segment is what is refused, not the opcode. Mutation: changing each `if ins.aux.mask == 1` guard to `if false` made the test fail on the load (different message from the PC check) and, with only the global.rs guard still mutated, on the store (translated instead of refused). Both sources restored byte-for-byte.@omonkeyz on GitHub · 2026-11-23 13:20 UTC · original
Closing as superseded: #284 lowers scratch-segment loads and stores, so these refusal pins would fail once it lands. Thanks.
Pull request closed