victory-shader: lower TFE image loads/samples/gathers via CheckAccessFullyMapped #1693
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1693
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1693"
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?
@tjthebigbearcat-hub on GitHub · 2026-11-24 20:47 UTC · original
tjthebigbearcat-hub:fix/starter-pr→main· +370 −2 · 4 files · 1 commits · openSummary
Implements TFE (Texture Fetch Enable) sparse-residency status feedback for RDNA 2 image
load,sample, andgatherinstructions (includingd16packing) invictory-shader:dx.op.checkAccessFullyMappedinemit/lower.rsand writes the residency status dword (0resident,1non-resident) to the extra destination register.SFI0bit0x100/ shader-flags metadata) inemit/shader.rswhen TFE status is checked.lweand TFE on stores, atomics, and size/LOD queries cleanly refused with clearer error messages.Verification (Windows 11 + SDK
dxil.dll+ WARP/GPU)emit/tfe_tests.rs(zero game bytes; verified withxtaskasset-policy check).cargo test -p victory-shader --locked tfe: 7 passed, 0 failed (including all 4 Windowsdxil.dll/ WARP / hardware GPU tests).cargo test --workspace --locked: 127 passed, 0 failed, 1 ignored invictory-shader; entire workspace green.cargo clippy --workspace --all-targets --locked -- -D warnings: 0 warnings.@upipibi on GitHub · 2026-11-24 22:52 UTC · original
NVIDIA run: RTX 3070 8 GB, driver 616.56, Windows 11, debug, at the PR head
77d21c6. Tests matchingtfe(the new TFE load / sample / gather / D16 cases and the refusals): 7 passed, 0 failed.It is based on
ffe310eand GitHub shows conflicts withmain70564ae, so this is the head as it stands, not a merge.AI-assisted (Claude Code). Synthetic tests only.
@Marvisak on GitHub · 2026-11-25 01:34 UTC · original · edited 2026-11-26 03:20 UTC
Automated triage for the maintainers.
Thanks for the rebase;
39c440bstill merges cleanly and CI (check) passes. It is the same head the previous verdict covered, and as your comment says, the substance is unchanged, so the verdict stays.Still needed:
emit/lower.rsis written0on every non-faulting access. The only hardware evidence in the thread (gfx1036) says the VGPR after the data keeps its old value on ordinary textures. Either leave the register unchanged where the host view cannot be non-resident, or cite a hardware or ISA source that says it is written0.victory translate --listrun onmainrefuses with "an image access with tfe or lwe".emit/mod.rsbullet ("added 2026-11-24").Verdict: needs work. CI: passing.
Generated by Claude Code
@Headache3318 on GitHub · 2026-11-25 01:45 UTC · original
Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head
77d21c6applied cleanly onto currentmainccfb029.cargo test -p victory-shader --locked: 99 passed, 0 failed, 1 ignored. All tests pass, including the 3 TFE tests that run on Linux (the 4 dxil.dll/WARP/GPU tests are Windows-only).cargo clippy -p victory-shader --all-targets -- -D warnings: 2 pre-existing unused-import errors in test code (fail identically on mainccfb029). The PR introduces no new clippy warnings.Not tested: Windows MSVC build, the title itself. AI-assisted.
@upipibi on GitHub · 2026-11-25 01:50 UTC · original
A hardware data point for the status dword, from reading, not a run here: boykopovar/AnyPS5#24954 measured MIMG
tfe/lweon gfx1036 with their hardware oracle, in wave32 and wave64. On ordinary (non-sparse) textures, the VGPR after the data is never written; it keeps its old value. That holds forimage_load,image_load_mip,image_sample_lz/_l,image_gather4_lz, also withd16, for in-bounds and out-of-bounds texels, mips past the last level, and a T#MIN_LOD_WARNabove the LOD.This PR writes
0there. On a non-sparse texture that only differs if a shader reads the status without first setting it, so it's unlikely to matter in practice. Sparse (PRT) textures, where a residency value would actually come from, weren't part of that measurement. Keeping the old register value for non-tiled views (and writing the residency bit only where the host view is tiled) would match it exactly.AI-assisted (Claude Code).
@tjthebigbearcat-hub on GitHub · 2026-11-25 03:19 UTC · original
Rebased cleanly onto current
main(940d32f→5d7fca5):lower.rs,mod.rs, andtfe_tests.rswith upstream's newrovs, BVH dispatch, 16-bit biased sample support (0b35b7f), and updated test struct fields.image_bvhto thetferefusal list so ray-tracing BVH instructions withtfefail cleanly rather than translating silently without residency handling.cargo test -p victory-shader --locked tfe(7 passed, 0 failed) andcargo clippy(0 warnings).@tjthebigbearcat-hub on GitHub · 2026-11-26 02:20 UTC · original
Rebased onto current
main(63bcca4), new head39c440b. It merges cleanly again.lower.rs,mod.rsandshader.rswere both sides adding code in the same place, so I kept both. Upstream'suses_lane_index/has_half_wave_masktest fields sit next totiled_resources, and its "Read marks" doc paragraph next to "Texel residency". TheUAVS_EVERY_STAGE(0x4) andTILED_RESOURCES(0x100) feature bits are both kept, and no flag bits overlap.cargo test -p victory-shader --locked --lib tfe: 7 passed, 0 failed.cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean.cargo xtask policy: 192 files ok.cargo test -p victory-shader --locked: 306 passed, 3 failed, 3 ignored. The three failures (stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride,stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros,synthetic_tests::gathers_at_a_level_match_the_hardware) fail the same way on a clean63bcca4on this machine. The stride ones look like the ones already tracked in #1744.lower.rsis now 522,198 B, 2,090 B under the 512 KiB cap.Not changed in this push: the TFE status dword still writes
0on non-sparse textures (upipibi's note above). The overlap with #1687 still needs reconciling, whichever of the two lands second.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.