Ports from RYUKI-7900XT and Scarlett: root-view reach, d16 image bits, NaN guard, early depth, strict spills, alias source #329
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!329
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-329"
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?
@GiovanniFadanelli on GitHub · 2026-11-26 17:21 UTC · original
GiovanniFadanelli:port/ryuki-shader-fixes→main· +895 −36 · 14 files · 10 commits · openSummary
Six fixes from other forks, ported onto
main(c9c932c). The original authors stay on the ported commits. Five of the six have an off switch, and the four shader switches are part of the shader-cache key.TRANSLATOR_VERSIONgoes 1 → 2, so every program is translated again on the first run.VICTORY_ROOT_WINDOW_MB, 32 (4 = the cell alone, as before)VirtualQuery) is cached for one secondVICTORY_ROOT_REACH_MS, 1000 (0 = asked every time)VICTORY_D16_BITS, on (=0 as before)VICTORY_NAN_GUARD, onDB_SHADER_CONTROLbit 12 and no depth/stencil/coverage export declareForceEarlyDepthStencilVICTORY_EARLY_DEPTH, ons_bfm_b32with 32-bit literals is resolved like inline constantsVICTORY_SPILL_STRICT, on (thes_bfmpart has no switch)Not ported: Scarlett's block-scoped
restored_lanesandNAN_GUARD_STORES.Overlap with open work
integer_viewfor d16 buffer accesses through views in tables. #2 here touches only the image load/gather path (thelegacyF32ToF16"shortcut" inlower.rs).9a6c829on main already covers buffer loads and stores. These are different functions, with no textual conflict expected.TRANSLATOR_VERSION1 → 2. Whichever merges second should go to 3.ir::buildunspill andspill::build. #5 here changes onlyresource.rs's tracer.Tests
Each switch has a test that fails with the switch off and passes by default (Windows 11, RX 9070 XT, release build):
shadow::window_tests::a_root_view_window_covers_the_memory_committed_after_its_cellVICTORY_ROOT_WINDOW_MB=4left: (…, 4194304) right: (…, 12582912)→ okshadow::window_tests::a_root_view_reach_is_used_again_within_its_timeVICTORY_ROOT_REACH_MS=0left: (…, 4194304) right: (…, 12582912)→ okemit::picture_fix_tests::a_d16_image_load_keeps_an_integer_views_bitsVICTORY_D16_BITS=0emit::picture_fix_tests::a_float_colour_export_turns_nan_and_infinity_into_numbersVICTORY_NAN_GUARD=0emit::early_depth_tests::a_pixel_program_tested_before_it_runs_declares_early_depth(ported)VICTORY_EARLY_DEPTH=0resource::tests::spilled_sgprs_are_not_followed_through_lanes_past_the_waveVICTORY_SPILL_STRICT=0resource::tests::a_bit_mask_from_a_literal_width_is_a_constantcopy_sourceleft: Value(Value(0)) right: Const(4294963200)→ okThe DXIL tests read
dxc -dumpbintext and are skipped when dxc is missing.dump_dxilnow writes one temp file per call, because two dumps on parallel test threads were writing the same file.No test for 1c (read lock) or 6 (alias source). 1c changes only the locking; the existing window tests pass. 6 needs a
HostListon a device, which the unit tests don't build.Crate suites (Windows 11, release, this branch vs
mainc9c932con the same machine)cargo test -p victory-shader --release --lib: 306 passed, 0 failed, 4 ignored, with one test skipped:emit::size_tests::the_record_count_of_a_structured_buffer_read_by_index. It ends the test process withSTATUS_ACCESS_VIOLATION, even when run alone, and it does the same onmain.cargo test -p victory-gpu --release --lib: 385 passed, 0 failed, 34 ignored on the first run. A later full run had one failure,watch::tests::a_block_just_written_rests, which passes 5/5 alone on both this branch andmain.mainhad a similar one-off failure inwatch::tests::what_is_put_in_beside_the_guards_is_told_at_every_view(assertion failed: published(two, two + BLOCK)), which also passes 5/5 alone. These are timing-dependent watch tests, not something these commits touch.descriptor::host::tests::views_are_made_beside_the_heap_and_copied_inandwatch::many_askers_tests::holes_are_known_until_the_runtime_tells, which fail on our Proton build, pass on Windows on both this branch andmain. That points to the Wine environment rather than these changes, but it was not checked under Proton here.Not tested
VICTORY_D16_BITSchecks the value at run time (≤ 0xFFFF or ≥ 0xFFFF8000), not the view's format. A float view returning such a bit pattern as a real denormal would also take the integer path. The source fork made the same choice.🤖 Generated with Claude Code
Ported by hand from YukiRyuu/RYUKI-7900XT f6dc189 (Op-lite/victory-scarlett squash; origins: myokex c3723f3 early depth, Neptune 25fbf69 NaN guard, cool_fox 8cc31ab strict spill lanes). All on by default, each with an off switch, and each part of the shader cache key: - VICTORY_EARLY_DEPTH: a pixel program with DB_SHADER_CONTROL bit 12 and no depth, stencil or coverage export declares ForceEarlyDepthStencil (glass prepass wrote over characters). - VICTORY_D16_BITS: d16 image loads and gathers keep an integer view's 16 bits instead of converting the denormal-looking bits as a float (0 or NaN before). - VICTORY_NAN_GUARD: float colour exports of pixel programs turn NaN into 0 and +-inf into +-65504, so one bad pixel does not persist in a blended history. - VICTORY_SPILL_STRICT: spilled SGPRs are followed only through plain lane moves inside the wave; s_bfm_b32 with 32-bit literals is resolved as with inline constants. TRANSLATOR_VERSION 1 -> 2: translations change, so earlier cached ones must not be served. Test (ported): a_pixel_program_tested_before_it_runs_declares_early_depth, red with VICTORY_EARLY_DEPTH=0 ("the early-depth flag changed nothing"), green by default. Not ported: Scarlett's block-scoped restored_lanes and NAN_GUARD_STORES.@GiovanniFadanelli on GitHub · 2026-11-27 12:29 UTC · original
Updated with what came out of the review of these same ports in Victory-Native (Sr-0w/Victory-Native#150, #193 and #194). There are four new commits on top; the six original ones are unchanged.
dd650c4, NaN guard off by default.VICTORY_NAN_GUARDnow acts only with=1and prints one line when it is on. It masked a wrong value and differs from RDNA's own export.TRANSLATOR_VERSIONgoes 2 → 3.be5f660, alias-source borrows. Drops two needless borrows thatclippy -D warningsrejects. No change in behaviour.142d74c, d16 by the view's format. A d16 image load or gather no longer guesses an integer view from the value it read:0xFFFF8000is both -32768 from anR16_SINTview and a NaN from a float one. The host now marks integer image views in its per-slot table, and the load reads that word through a new root SRV,SLOT_KINDS.TRANSLATOR_VERSIONgoes 3 → 4. The testemit::d16_tests::a_d16_image_load_converts_by_the_views_kind_not_its_valuedispatches on the hardware GPU and WARP with the same texel bits through an integer view and a float view. It fails with the old rule.f146ed8, no reach cache. This revertsdad08cf. The one-second cache of the committed reach could go stale after a remap at the same address, and Victory-Native dropped it (Sr-0w 884dec4, fb459c8).VICTORY_ROOT_REACH_MSis gone. Three tests cover it: a decommit with no notice, a same-address remap, and a commit that grows the window. The cost is that every root-view window queries Windows again, which the cache had saved; I haven't measured that here.Checks on Windows 11, RX 9070 XT, release build:
victory-shader tests: 306 passed (the structured-buffer size test that crashes the process on main too was skipped).
victory-gpu tests: 388 passed.
cargo xtask policy: 266 files ok.Clippy is clean for victory-gpu and victory-shader apart from
unnecessary_mut_passedat watch.rs:3626. With--workspaceit also stops on the transmute lint in victory-loader/src/descriptor_sites.rs:277. Both lints are already on main, in files this branch doesn't change.Not checked: nothing was run in game, nothing under Wine/Proton, and the commits are not signed.
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.