Repository navigation
Conversation
AHalfLanes took a constant operand as is, ignoring its swizzle (bits 60..61 of the 32 slot), so HMUL2 R37, R37.H0_H0, c[0x0] [0x168].H0_H0 gave the high lane the constant's other half. Value 1 was read as .H1_H1; nvdisasm names it .F32 in all three slots, the operand's own 32-bit float. MUFU.F16, whose bits 60..61 pick one half, keeps its reading. New HalfSwizzle tests in test_dmsh_ampere_alu.py (3 fail on main). A GPU cross-check of 900 HADD2 / HMUL2 / HFMA2 against an exact binary16 reference went from 86 constant-swizzle mismatches to none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bit 80 of HSETP2 and HSET2 was dropped. AFtz (FSETP / FSET) does not fit the half lanes: unpacked to 32-bit floats, a half's subnormals are normal, so FlushDenormal's bound never flushes them. AHalfFtz flushes each lane under the half's own bound (2^-14) before the comparison. New HalfCompareFtz tests in test_dmsh_ampere_alu.py (two fail on main). A GPU cross-check with subnormal and zero inputs: 4 mismatches in 400, none with the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fpedrolucas95
pushed a commit
to fpedrolucas95/nxnative
that referenced
this pull request
Nov 6, 2026
…, .F32, and HSETP2 / HSET2 .FTZ
fpedrolucas95
pushed a commit
to fpedrolucas95/nxnative
that referenced
this pull request
Nov 6, 2026
…, seedds#1410, seedds#1411, seedds#1412, seedds#1413, seedds#1414, seedds#1329 on top of main's translator fixes): chain c9cf9613657e Publishes Ryujinx.Graphics.Shader, Ryujinx.Common, Spv.Generator and dmsh_xlate (osx-arm64, framework-dependent, the universal launcher kept) from the merged source; the PRs' own binaries were built without this tree's translator changes (float atomic adds, F2IP, the growing raw pool table). The lock and dmsh_chain.h are written again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 task done
javierdv7
pushed a commit
to javierdv7/nxnative
that referenced
this pull request
Nov 6, 2026
…#1462's CAS, seedds#1487, seedds#1329, seedds#1410, seedds#1411, seedds#1412, seedds#1357): lock and chain header; conflict leftovers removed from shaders.md and test_dmsh_ampere_alu.py
seedds
added a commit
that referenced
this pull request
Nov 7, 2026
…TZ as Ampere reads them (chain 9776347fc0a7, PR #1410) Three half-pair defects found by a GPU cross-check against an exact binary16 reference: AHalfLanes took a constant operand as it is, so HMUL2 R37, R37.H0_H0, c[0x0][0x168].H0_H0 gave the high lane the constant's other half (nvdisasm names the swizzle in all three slots, A 74..75, the 32-bit slot 60..61, the 64-bit slot 81..82; only an immediate has none), which reached HSETP2 / HSET2 / HMNMX2 through AHalfSecond too; swizzle value 1 is .F32, the operand's own 32-bit float, not .H1_H1 (MUFU.F16's half select keeps its reading); and HSETP2 / HSET2 .FTZ (bit 80) was dropped: a subnormal half compares as zero, flushed under the half's own bound (2^-14) since the lanes are unpacked to 32 bits. Checked: test_dmsh_ampere_alu HalfSwizzle and HalfCompareFtz (5 of their checks fail on the translator before), the 21 translator test files (test_dmsh_pairs' two NameErrors as before), test_nsp_chain, test_xlate_anycpu, test_docs. No game is named by the author; half math on uniforms is common in Switch 2 shaders. Regression: one Ocarina of Time run on the chain that ends this batch. Co-authored-by: Copak731 <224629733+Copak731@users.noreply.github.com>
Owner
|
Landed as 9dc8195 with you as co-author (HalfSwizzle and HalfCompareFtz fail before, pass after). Thank you. |
Aznracer
pushed a commit
to Aznracer/Mighty-Green-Kokiri-Kid
that referenced
this pull request
Nov 8, 2026
…TZ as Ampere reads them (chain 9776347fc0a7, PR seedds#1410)
Know-It-All-Brother
pushed a commit
to Know-It-All-Brother/nxnative
that referenced
this pull request
Nov 9, 2026
…TZ as Ampere reads them (chain 9776347fc0a7, PR seedds#1410) Three half-pair defects found by a GPU cross-check against an exact binary16 reference: AHalfLanes took a constant operand as it is, so HMUL2 R37, R37.H0_H0, c[0x0][0x168].H0_H0 gave the high lane the constant's other half (nvdisasm names the swizzle in all three slots, A 74..75, the 32-bit slot 60..61, the 64-bit slot 81..82; only an immediate has none), which reached HSETP2 / HSET2 / HMNMX2 through AHalfSecond too; swizzle value 1 is .F32, the operand's own 32-bit float, not .H1_H1 (MUFU.F16's half select keeps its reading); and HSETP2 / HSET2 .FTZ (bit 80) was dropped: a subnormal half compares as zero, flushed under the half's own bound (2^-14) since the lanes are unpacked to 32 bits. Checked: test_dmsh_ampere_alu HalfSwizzle and HalfCompareFtz (5 of their checks fail on the translator before), the 21 translator test files (test_dmsh_pairs' two NameErrors as before), test_nsp_chain, test_xlate_anycpu, test_docs. No game is named by the author; half math on uniforms is common in Switch 2 shaders. Regression: one Ocarina of Time run on the chain that ends this batch. Co-authored-by: Copak731 <224629733+Copak731@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Three half-pair defects, found by a GPU cross-check against an exact binary16 reference (one rounding, FMA included).
AHalfLanestook a constant as is, soHMUL2 R37, R37.H0_H0, c[0x0] [0x168].H0_H0(a half scaled by one half of a uniform) gave the high lane the constant's other half. nvdisasm names the swizzle in all three slots (A 74..75, the 32 slot 60..61, the 64 slot 81..82); only an immediate has none. This also affected HSETP2 / HSET2 / HMNMX2 throughAHalfSecond..F32, the operand's own 32-bit float (nvdisasm), not.H1_H1. Its exact rounding on NVIDIA is not documented; the float itself is the closer reading. MUFU.F16, whose bits 60..61 pick one half, keeps its reading (MufuF16caught an early version of this change)..FTZ(bit 80) was dropped. A subnormal half must compare as zero, asAFtzalready does for FSETP / FSET; but the lanes are unpacked to 32 bits, where a half's subnormals are normal floats, soAHalfFtzflushes under the half's own bound (2^-14)..H_ANDkeeps the reading NAK'sOpHSetP2.horizontaldocuments.Reference entries:
docs/reference/shaders.md, "Half-pair swizzle on a constant, and .F32" and "HSETP2 / HSET2 .FTZ".Checked
DMSH_TEST_XLATE=<translator> python3 dm/gfx/tests/test_dmsh_ampere_alu.py, newHalfSwizzle(3) andHalfCompareFtz(3); the five checks of the fix fail onmain. Alltest_dmsh_*.pypass.dmsh_xlateusing the production options (debugandreducedon, asdmsh_build.py), convert with spirv-cross 1.4.363.0 at MSL 2.3, run them on the GPU and compare every bit with a reference written from the oracle, PTX's documentation and Mesa NAK where it applies.): HADD2 / HMUL2 / HFMA2 / HSETP2 / HSET2 / HMNMX2, 1,200 instructions: 89.7 % identical onmain, 96.8 % with the change (86 constant-swizzle mismatches in HADD2 / HMUL2 / HFMA2 and 15 in HSETP2 to none; 4 FTZ compares in 400 subnormal inputs to none). Left: arithmetic.FTZon subnormals (dropped by design),.RELUon NaN, and NaN payloads.Docs
docs/reference/shaders.mdentry, andpython3 dm/tools/docs_symptoms.pywas run (the symptom index)🤖 Generated with Claude Code