Shaders: lower v_cvt_f32_f64 (binary64 to binary32) #52
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/52"
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?
Imported from Zettrox/ztrx. Originally posted by Altorru on 2026-11-25T06:10:18Z.
Ports the
v_cvt_f32_f64support fromfxceless/victory-fork@3bff182(the match arm,f64_pairandf64_to_f32_bits), without that commit's unrelated changes.Why: the instruction decoded but had no lowering, so any shader using it failed with '
...is not supported' and its pipeline was dropped. Issue #38 names three compute programs stopped byv_cvt_f32_f64(5dc3b25986622949,6f225b641c5b0708,926c46bab3b86bd6).What: reads a binary64 operand as
(lo, hi)dwords (VGPR or SGPR pair, inline f64 constants, or a 32-bit literal in the high dword) and converts to binary32 bits with round-to-nearest-even, subnormals, infinity and NaN, using integer operations only (no hostDOUBLESsupport).Verification: new host test
cvt_f32_f64_lowersbuildsv_cvt_f32_f64 v1, s[16:17]and lowers it;cargo test -p victory-shaderpasses (171 tests). Numeric behavior on hardware is covered by the upstream test this is taken from; I could not run a GPU here.Imported from Zettrox/ztrx. Originally posted by Altorru on 2026-11-25T06:37:21Z.
Rebased-free follow-up: the test moved to the end of
mod tests(same test, same encoding, unchanged behaviour). It used to sit at the same anchor as #49'spermlane16_and_x16_lower, so the two PRs conflicted textually even though the arms they cover are unrelated. Both orders now merge cleanly, andcargo test -p victory-shaderis still 171 passed.Imported from Zettrox/ztrx. Originally posted by Aniseto on 2026-11-25T14:39:34Z.
Ran the shader tests at
3f21662(clean PR head onmain90b529f):System
rust-toolchain.toml), MSVC 14.44.35207, DXIL validator 1.9.2609.5 (VICTORY_DXIL), debug buildResults
cargo test --locked -p victory-shader --lib cvt_f32_f64_lowers -- --nocapture: 1 passed, 0 failed, 0 ignored, 212 filtered out (exit 0)cargo test --locked -p victory-shader --lib -- --test-threads=1: 211 passed, 0 failed, 2 ignored (exit 0)cargo test --locked -p victory-shader --lib emit::intersect_tests::the_32_bit_node_test_in_a_host_buffer_matches_the_reference_on_the_card -- --exact --nocapture: 1 passed, 0 failed, 0 ignored (exit 0). That test asserts an SM 6.6 device is available, so the GPU path ran on this adapter.What this adds
The PR says the author could not run a GPU, and the thread has no hardware report: this is the first run of this change on a real card. The new
cvt_f32_f64_lowerstest passes here; it checks the emitted lowering only. The numeric behavior ofv_cvt_f32_f64on hardware is not measured by that test, so I am not claiming it here. The hardware part of this report is that the crate's GPU tests run through the real adapter on this Blackwell part with DXIL validator 1.9.2609.5.Not tested
The three shader programs named in issue #38, the title's shader pack, live pipeline creation, retail runs, a WARP control lane, the console compiler's DXC, release profile, AMD and Intel GPUs.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.