Shaders: honor directed rounding in v_pk_mul_f16 #3811
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3811"
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 Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T23:51:39Z.
v_pk_mul_f16now rounds each 16-bit product in the active half-precision mode. It reuses the exact-product narrowing from #3804. This branch includes that scalar prerequisite. The final commit covers packed multiplication and its regression.The regression checks 529 input rows for each of four rounding modes and two operand selections. The second selection exchanges one input's halves and applies different negations. On
386cc0f, each directed mode mismatched 189 of 1,058 packed words per software invocation. After the fix, all 8,464 packed words matched the CPU reference on two app-local Microsoft WARP invocations. The scalar multiply test, existing FP16 controls, 33 lowerer tests, both strict Clippy configurations and the asset policy passed.The specification describes the half rounding modes and the two packed products. AMD RDNA 2 ISA, sections 6.4 and 12.10
Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change into another commit.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T23:55:02Z.
Windows CI passed on
535a68d, including both Clippy configurations and workspace tests. The packed multiply regression matched 8,464 result words on the two local WARP invocations. It covers both ordinary packed operands and independent half selection and sign changes.The next step is maintainer review alongside the scalar prerequisite #3804. Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change into another commit.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-29T00:22:18Z.
I combined #3811 at
535a68dwith the #3803/#3804 comparison at9248dbaand #3807 atafadaa9. The three inputs keep their original Git history. The merge retains all four regressions and shares one directed narrowing path for the two conversions and both scalar and packed multiplication. The packed path continues to round after half selection, sign changes and saturation.On
ecb7a6b, WARP 1.0.22 with Agility 1.620.2 matched all result words across two software-device invocations:The existing FP32-to-FP16 modes 0 and 3 control, all 33 lowerer tests, both strict shader Clippy configurations and the asset policy also passed. The combined
lower.rsis 522,828 bytes. A physical GPU run of this integration is pending.Please retain the Git authors on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the integration into another commit. Comparison branchAI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-29T00:24:38Z.
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
535a68ded604e606e0c11d1f9fad2bd287ce9d32; this PR stacks on #3804, so its single-commit parent/base is386cc0fcc55351a2d8722f0a0ceef7c20423d185.cargo test --locked -p victory-shader --lib -- emit::semantics_tests::packed_f16_multiply_honors_round_mode --exact --test-threads=1 --quiet→ 1 passed, 0 failed, 306 filtered, exit 0. The other added test (f16_multiply_honors_round_mode) duplicates the one already verified independently in #3804, so I did not replay it here.git grep -Fforpacked_f16_multiply_honors_round_modeon the parent returned no match (test is new);git diff --check HEAD^ HEADclean (2 files, +43/-6 relative to its parent).CARGO_TARGET_DIR(never shared) withCARGO_BUILD_JOBS=2.AI-assisted (Hy4 flash).
Imported from Marvisak/VIctory. Originally posted by passerbyyhx on 2026-12-01T14:03:13Z.
The standalone packed change now has a physical NVIDIA comparison. On an RTX 4090 Laptop and WARP at
535a68de, all 4,232 packed words per adapter matched the CPU model across four rounding modes, two operand selections and 529 input rows. On the immediate scalar-fixed parent386cc0fc, rounding toward +∞ gave 90 + 99 mismatches across the two selections and rounding toward −∞ gave 99 + 90 on each adapter. Nearest-even and toward-zero matched on both revisions. The physical device and WARP agreed in every case, including the parent's incorrect outputs.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.