Shaders: honor modifiers in f16 conversions #1545
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!1545
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1545/head"
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?
@Calvix2k on GitHub · 2026-11-24 19:01 UTC · original
Calvix2k:codex/shader-cvt-modifiers-028→main· +41 −5 · 2 files · 1 commits · closed without mergingSummary
Fixes modifier handling in the
opsel == 0fast paths for two 16-bit conversion instructions:v_cvt_f32_f16now uses the existing half-float source path, preserving VOP3absandnegsemantics.v_cvt_f16_f32applies VOP3clampbefore converting the f32 value to f16.Verification
cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings: passed.cargo xtask policy: passed (154 files ok).rustfmt --edition 2024 --checkonvalu_tests.rs: passed.lower.rshas pre-existing formatting differences elsewhere in the file.cargo test -p victory-shader --locked -- --test-threads=1: 107 passed, 1 ignored, 15 failed because existing GPU tests require an available SM 6.6 hardware/WARP device, which this system lacks.Synthetic tests only; no game assets used.
@sinan-cmyk on GitHub · 2026-11-24 19:33 UTC · original
Offline measurement on a retail dump, and the shader tests on Ada
Result: no count changes against
main, and the tests pass on Ada.Offline. I merged head
f3d0ab9ontomainffe310e(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 21,724 on both, 0 gained, 0 lost. No program changes its failure reason either.This is the expected result for a correctness fix whose instructions sit behind the earlier failures on
main. The count shows that the change rejects nothing. It does not show whether the output is right.Tests. With the same merge,
cargo test --locked -p victory-shader --libpassed 122, failed 0. The bitcode benchmark is ignored, as onmain, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, withVICTORY_WARPunset.No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@geiyiliyabumo on GitHub · 2026-11-24 19:34 UTC · original
Verified commit
f3d0ab9on Windows 11 / AMD Radeon RX 9060 XT (RDNA4,gfx1200, SM 6.6) + WARP:cargo test -p victory-shader --lib: 122 passed, 0 failed, 1 ignored (including the new f16 conversion modifier GPU tests).AI-assisted; synthetic tests only, no game files.
@tdogghockey on GitHub · 2026-11-24 19:37 UTC · original
I independently checked this at head
f3d0ab9on aarch64 Linux.cargo test --offline -p victory-shader --locked— 96 passed, 0 failed, 1 ignored.cargo check --offline -p victory-shader --all-targets --locked --target x86_64-pc-windows-msvc— clean.cargo clippy --offline -p victory-shader --all-targets --locked -- -D warningsreports the same two pre-existing unused-import errors inemit/mod.rson baseffe310e, so I don't attribute them to this PR.rustfmt --checkonlower.rsreports the same three pre-existing diff hunks as base.Source check: the
v_cvt_f32_f16fast path now goes throughhalf_fsrc, which applies abs then neg afterlegacyF16ToF32, and thev_cvt_f16_f32fast path clamps before narrowing. That matches the stated VOP3 semantics. The new tests live in#[cfg(all(test, windows))] emit::valu_tests, so they could not execute on this Linux host; Windows-target compilation only is confirmed here.No correctness issue found in the verifiable surface. No approval implied.
@Calvix2k on GitHub · 2026-11-24 22:01 UTC · original
Superseded by upstream
77053a0: the opsel == 0 path forv_cvt_f32_f16now reads through the half-float source path (abs/neg preserved), and the 16-bit float result path appliesclampbefore the singlenarrow16conversion. Both regressions this PR adds are covered upstream; closing to avoid a duplicate conflict. Thanks for the targeted cases.@Calvix2k on GitHub · 2026-11-24 22:01 UTC · original
Closing as superseded by upstream
77053a0.Pull request closed