Repository navigation
Conversation
…stream VIctory #1554)
|
A hardware run of this PR's new test: |
|
I ran This was the PR applied to the |
…haders 2.1 fxceless f5c03f3 (PR fxceless#999), texback.rs: textures of the water kinds that shaders write are copied into read-back buffers when the list closes and tiled back into title memory once it has run, so the CPU's ocean sampling (boats) reads what the GPU wrote. ON by default here: VICTORY_TEXTURE_BACK unset or 1 takes the four water kinds, 0 turns it off, a list of <w>x<h>f<format> picks others. Merged with this tree's in-place write ranges (Deferred::placed): flights now carry both their placed ranges and their readback ranges. 2.2 fxceless a35c557, VICTORY_TARGET_VARIANTS (on unless =0): a draw into a render target whose format differs from what its pipeline declares for that slot gets a pipeline of the same state for the bound formats. Adapted to this tree's blending: host_blend() still turns blending off per format at creation, and integer_targets_unblended() now keeps the title's blend state (blend_as_given) for variants to start from. RTV records and pipeline states both carry stand-in formats (target_format), so they compare like for like. fxceless 025b042 (integer targets do not blend) was already here as e92dbb4; not ported again. 2.3 Marvisak 842b0cb7 (fxceless#158) not ported: the depth bounds test already reaches the host here (c96b4f2, fxceless#82: OMSetDepthBounds, adapter check, DEPTH_STENCIL1 for vertex and mesh streams, replay, test). 2.4 fxceless PR fxceless#808: v_dot4_i32_i8 / v_dot4c_i32_i8 / v_dot4_u32_u8 and v_dot2* lower to DXIL dot4AddPacked and fmad (emit/dot.rs, listed in sources(); Module::eval_u32 for constant operands). Only the PR's lowering and its new test were taken; the PR also deleted unrelated valu tests (cvt_f32_f64, permlane16), which stay. byte_dot_products_match_the_hardware is no longer ignored. 2.5 Shader correctness batch: - fxceless PR fxceless#1041: resource::track visits blocks in reverse postorder. - fxceless PR fxceless#1042: saturating clamp on packed 16-bit integer ops, with its tests (its clamp-taking vop3p helper kept; fxceless#808's test uses its own vop3p_dot). - Marvisak f3578e3 (#2493): f16 inline float constants in whole-wave v_add_f16 simulation; its test expects this tree's Shape::Active instead of Marvisak's Shape::Half. - justr4mzi 6ba165b2 (fxceless fxceless#1030): a ds_swizzle source lane outside EXEC reads zero. Restricted to console wave32 compute (no exchange, no twin), where the host lane is the console lane; the wave64 forms on 32-lane hosts keep the plain read, since a host ballot does not see the console's upper 32 lanes. - justr4mzi 640262ee (fxceless fxceless#1024): image_get_lod on cubes in pixel shaders (lower_image.rs), with its test. - justr4mzi a15e95d8 (fxceless fxceless#1019): typed half loads keep NaN payloads (widened through a finite half), with its test. - Skipped, not in this tree: Marvisak e815cef (#2484, the dirty bitmap of its memory view; ours is a page directory of copies), 366a978 (#2468, no dead_on_edge here), 120233c (#2448, no Lower::konst here). - Skipped on purpose: justr4mzi 6c9a9032 (fxceless fxceless#1026) makes v_mac/v_mad_legacy_f32 fused with flushed sources. Neither upstream has merged it, and the semantics reference here and in Marvisak/VIctory still takes the legacy multiply-add unfused; it is the title's most used arithmetic, so it waits for a hardware measurement. Gate: Windows check, diagnostics check, clippy -D warnings (default and all features), tests 342 passed / 0 failed / 8 ignored, policy 230 files ok, viz. The semantics and valu tests (and the new victory-gpu tests) are Windows-only: built and linted here, not run; pc-home is offline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
In-game follow-up on RTX 5070 Ti (621.40). I ported the PR’s lowering to Neptune and retranslated only the final composite pixel shader. Both runs used the same runtime executable, Series X checkpoint, 4K output, and water compute shader. A hash comparison of all 2,922 warm-cache files found exactly one changed entry. The revised DXIL validated, pipeline creation succeeded, and the shader’s bindings were identical. At the held boat view, the stock composite showed black cores in the brightest water reflections. The revised composite showed bright cores in two captures over a minute apart. The sun disk was outside the frame, so this verifies the water reflection symptom in this scene. Over about 60 seconds each, stock and revised logged 6.47 and 6.38 DXGI-accepted presents/s respectively. Median intervals were 165.9 and 157.9 ms. This was one stationary A/B pair. AI-assisted testing and analysis. In a later Neptune replay with the revised composite, tilting the camera up showed a bright sun center in two captures. A readback immediately before a revised composite draw captured all three 33³ RGBA16F color lookup volumes. Every sample was finite and the upper corner of each volume was bright. That gives a clean reference for comparing the stock draw’s sampled inputs. |
…e boat); legacy multiply-add as RDNA 2 runs it; 32-bit integer typed views move bits; removal and world-frame instruments; placed-slot census; skin-bake sources and reaper off by default - At a device removal: the sixteen seconds before it, one row a second, and the pipelines first drawn with lately; the PC by the minute. - Host objects let go can be dropped by a thread of their own (VICTORY_REAPER, off); the frame log counts the world's frames apart. - Legacy multiply-add as RDNA 2 runs it: fused, sources flushed, zero-factor rule (pull request #1026). - Typed buffer views of 32-bit integer formats are made in the float format of the same width (pull request #684). - Placed texture slots counted by what they show every 5 s; textures with levels on demand that show no level; VICTORY_TILES_SMALL_WHEN_FULL_MB and VICTORY_RETIRE_LEAN (both off). - Skin-bake draws' own textures: VICTORY_BAKE_SOURCES=count|1 (off; pull request #1264, hand-ported onto the texture worker). - README: status and frame rate as measured.
|
The fused-rounding case in I dumped that test's SPIR-V. It has a GLSL.std.450 Fma, with NoContraction on the separate zero-addend instruction only. Adding NoContraction to the Fma alone, validating the module and rerunning the same test through vkd3d's shader override made all four hardware cases pass. I then removed the override and ran the unmodified binary with vkd3d's FORCE_NOCONTRACT_MATH shader quirk. That also passes all four, and the emitted Fma has the decoration. This reproduces a backend-specific rounding difference without the game. I haven't established a link to facial deformation. The WARP-labelled run here falls back to the same physical adapter under DXVK. |
What comes from upstream (previous merge base 988aa41): - VICTORY_HEAP_WORKER=1 (off): textures picked by index uploaded by a thread of their own (fork pull request fxceless#1007); needs VICTORY_LATE_WAIT (stage > 0, which the relay sets by default). - VICTORY_TABLE_STAGES (off): a draw's stages share the tables they make afresh. - VICTORY_HEAP_LOCKS (off): made slots found without the slots' lock (atomic made_now), kept resources in 64 locks. - VICTORY_BAKE_SOURCES=count|1 (off): skin-bake draws' own textures (fxceless#1264 hand-ported onto the texture worker). - VICTORY_REAPER (off): host objects let go dropped by a thread of their own. - VICTORY_TILES_SMALL_WHEN_FULL_MB and VICTORY_RETIRE_LEAN (both off). - Legacy multiply-add as RDNA 2 runs it (pull request fxceless#1026). - Typed views of 32-bit integer formats made in the float format of the same width (pull request fxceless#684). - Remapping time split in the frame log (unmap, map, commit, our notes). - The corner box shows the machine's load beside the frame rate (VICTORY_FPS_COUNTER=fps: the rate alone; =0: off). - A report at a device removal; placed-slot census; constant buffer view of no bytes stays one (fxceless#1260, one copy kept); diagnostics runs 301-309. Conflicts: - README.md: ours kept as is; upstream's added as README.upstream.md. .github/workflows/ci.yml unchanged from ours. - crates/victory-gpu/src/descriptor/host.rs: both. Our SlotSet and slot flags beside upstream's KEPT_PIECES/heap_locks(); HostHeap::new takes the 64 kept pieces and kept_one, sized count + extra, with next/free sized by our per-heap dynamic count (extra), not DYNAMIC. The lock-free made_now lookup goes in mirror_inner, before the records' lock (our mirror_with_made is called with the lock held), returning (view, None); made_now stores added to our keep-views return and after our make/keep branches. - crates/victory-gpu/src/draw.rs: upstream's bake-sources/worker pass setup, with our TEXTURE_SHORT short_room/since_short in front of it; our ShortOfRoom guard kept before upstream's List/Ahead view lookup. - crates/victory-hle/src/modules/xmem.rs: our title_memory_view call (section.handle) plus upstream's RemapNotesUs timing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Closing: the owner took this change into UwUCammie's finding still applies to — Fable |
Upstream since 9c184b3: VICTORY_SETTLE_ROOM, VICTORY_PARALLEL_REFRESH, VICTORY_DISPATCH_SPREAD, the lookup cache's race fix (fxceless#1245), dynamic slots found across the search start, legacy multiply-add as RDNA 2 runs it (fxceless#1026), 32-bit integer typed views (fxceless#684), BC7 rotation, the corner box's load figures, VICTORY_HEAP_LOCKS / TABLE_STAGES / LIST_REUSE / HEAP_PASS_MARKED / CARD_SYNC_BATCH (off), ABSENT_ONCE and LIGHT_REFRESH (off), and its instruments. Resolutions: - watch.rs: upstream's file with fxceless#1067's BlockRuns kept (guard walk over the clean set's gaps, protected runs given back in one call) and upstream's noted-absent logic inside that walk; PUBLISHED bits cleared run by run. The local parking (VICTORY_VIEW_PARK, off) is dropped for upstream's ABSENT_ONCE / ABSENT_MS=told, which does the same. - descriptor/host.rs: one lock-free array (made_fast, fxceless#1117's path, on whatever the switch); upstream's made_now writes go to it, including the kept-view store; VICTORY_HEAP_LOCKS keeps its split keep locks. - indirect.rs: a record that can be spread across z is (upstream); one that cannot keeps the AMD wide x (VICTORY_INDIRECT_WIDE). - host.rs: a closed gather still goes to run slots (fxceless#1171); a record refused by VICTORY_GATHER_BY_COPY gets a pass of its own. - shadow.rs: fxceless#1245's order on our RwLock tables (fxceless#1068). - xmem.rs: remap timing on our persistent/temporary views (fxceless#872) and the skipped recommit (fxceless#1103). - policy: host.rs may be 640 KiB, as lower.rs (local).
Ports upstream Marvisak/VIctory#1554 (
Calvix2k).Problem
In
crates/victory-shader/src/emit/lower.rs,v_mad_legacy_f32andv_mac_legacy_f32were lowered as unfusedlegacy_mul(a, b) + cwithout flushing subnormal operands.On RDNA2 / Xbox Series X, the legacy multiply-add encoding decodes as fused (
v_fma_legacy_f32), flushes subnormal f32 source operands to signed zero, and keeps the legacy zero-factor rule (0 * inf/NaN = +0, so+0 + c).What changed
crates/victory-shader/src/emit/lower.rs:Lower::ftzto flush f32 subnormals ((bits & 0x7F80_0000) == 0) to signed zero while preserving the sign bit and all normal/inf/NaN values.Lower::legacy_fmadusingself.fmad(a, b, c)with the legacy zero-factor override (+0 + cwhena == 0orb == 0).v_mad_legacy_f32andv_mac_legacy_f32throughftzon all three sources followed bylegacy_fmad(leaving non-legacyv_mad_f32/v_mac_f32unfused andv_fmac_f32unchanged).crates/victory-shader/src/emit/valu_tests.rs(legacy_mad_fuses_its_product_and_flushes_its_sources):v_mad_legacy_f32test covering single-rounding fusion (on hardware adapters),subnormal * 1.0 + 0.0 == 0.0,subnormal * +inf + 1.0 == 1.0(proving source FTZ happens before the zero-factor check), and0 * +inf + 1.0 == 1.0.Verification
Verified on Windows (
windows-latest+dxil.dll+ D3D12 WARP) via a temporary scoped CI branch on the fork:cargo clippy -p victory-shader -p xtask --all-targets --locked -- -D warnings: passedcargo clippy -p victory-shader -p xtask --all-targets --all-features --locked -- -D warnings: passedcargo test -p victory-shader -p xtask --locked -- --nocapture:victory-shader216 passed; 0 failed; 3 ignored(test emit::valu_tests::legacy_mad_fuses_its_product_and_flushes_its_sources ... ok, validated viadxil.dlland executed on D3D12 WARP);xtask4 passed; 0 failed(includingrepository_passes_policy).Note: CI checks were scoped to
-p victory-shader -p xtaskbecauseupstream/main(fxceless/victory-fork) currently has unrelated pre-existing Clippy errors incrates/victory-gpu.— Neon