Shaders: expand synthetic unit tests for emit/sampler.rs #1018
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#1018
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@geiyiliyabumo on GitHub · 2026-11-24 15:06 UTC · original
Summary
Audits
crates/victory-shader/src/emit/sampler.rsand expands deterministic synthetic unit tests from 1 to 6 passing tests covering everySQ_IMG_SAMP_WORD0-3bitfield and boundary mapping. Production code is unchanged.Because external PR creation is currently restricted (
collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:geiyiliyabumo/VIctory@test/shader-samplergeiyiliyabumo/VIctory@ed1d9c7(based onmainffe310e)Tests Added (
crates/victory-shader/src/emit/sampler.rs)address_modes_map_all_eight_hardware_encodingsanisotropy_clamps_above_sixteen_and_comparison_covers_all_eightmip_lod_bias_decodes_signed_14bit_fixed_point_extremesno_mip_filter_forces_zero_lod_range_and_non_zero_preserves_itfilters_reductions_and_border_colours_decode_cleanlyVerification (Windows 11 x64 MSVC)
rustfmt --edition 2024 --check crates/victory-shader/src/emit/sampler.rs: PASScargo xtask policy: PASS (154 files ok)cargo clippy -p victory-shader --all-targets --locked -- -D warnings: PASS (0 warnings)cargo test -p victory-shader --locked -- emit::sampler::: 6 passed, 0 failedAI-assisted; synthetic tests only, no game files.
@DrDarkDK on GitHub · 2026-11-24 15:10 UTC · original
I exercised the decoded LOD biases from
ed1d9c7through the D3D12 static-sampler root-signature path. On native Windows, both RTX 4070 Ti and WARP accepted-16.0and15.98828125and created the compute PSO. The next representable values outside the D3D12 range,-16.00390625and15.9921875, were rejected at the root-signature step. The decoder’s extremes,-32.0and31.99609375, were rejected there too.The bitfield test can keep asserting the original decoded value. This is a separate case for how the host handles biases it cannot accept. Synthetic test only. I haven’t checked whether the title uses those values.
AI-assisted with Codex.
@heromike405-arch on GitHub · 2026-11-24 15:17 UTC · original
Cross-check on Windows 11 (build 26100) with an RTX 5060 Laptop GPU and Radeon 610M. I used a synthetic static sampler with
D3D12SerializeVersionedRootSignature, root-signature version 1.1, and the same flags asemit/host.rs.0x2000(-32) and0x1FFF(31.99609375) returnedE_INVALIDARGat serialization.-16.0and15.99) serialized successfully and passedCreateRootSignatureon both hardware adapters.The two extreme-value assertions in
mip_lod_bias_decodes_signed_14bit_fixed_point_extremescurrently callStaticSampler::from_wordsdirectly. #326 clamps in that same function, so those assertions would fail if both changes landed as written. If the clamp stays there, updating the two expectations would cover the value sent to D3D12. Testing raw sign extension would then require a separate raw decode step.Standalone D3D12 probe, synthetic input. AI-assisted with Codex.
@Marvisak on GitHub · 2026-11-25 07:00 UTC · original · edited 2026-11-25 09:57 UTC
Automated triage for the maintainers.
These are test-only additions for
crates/victory-shader/src/emit/sampler.rs; the branch is open as PR #1195. Note from the comments: two of its assertions expect the raw decoded LOD bias extremes (-32 and ~32), which D3D12 rejects at root-signature serialization; if a clamp to the D3D12 range lands inStaticSampler::from_words, those expectations need updating. Review continues on #1195.Generated by Claude Code
@StExpeditus on GitHub · 2026-11-25 09:36 UTC · original
Validated the fork branch on Windows 11 Pro 26200 (Intel Core i5-14600K, RTX 5060 Ti, driver 621.24, Rust 1.98.1 MSVC), commit
a711eb3:cargo test -p victory-shader --locked --no-fail-fast-> 246 passed, 3 failed, 3 ignored. Failed: test emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride ... FAILED | test emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros ... FAILED | test emit::synthetic_tests::gathers_at_a_level_match_the_hardware ... FAILED Synthetic tests only, no game files.@StExpeditus on GitHub · 2026-11-25 09:37 UTC · original
Addendum: the 3 failures (
a_heap_buffer_read_by_element_takes_the_views_stride,a_heap_buffer_read_where_no_buffer_view_is_reads_zeros,gathers_at_a_level_match_the_hardware) are the pre-existing NVIDIA 1M-view-heap-cap failures that also fail on current main; nothing introduced by this patch fails.