shader: preserve signed zero in floating-point min and max #2037
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2044"
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 R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T23:35:36Z.
Change
Resolve a pair of floating-point zeros by sign in the offline pixel and startup shader translators. Max uses the AND of the sign bits and min uses the OR. The same helper feeds min3, max3, med3 and the per-half binary16 packed min/max path. Other operand pairs still use the existing float operations. Packed NaN selection, output modifiers and integer min/max are unchanged. The startup cache revision advances to
x2w-startup-shader-9(main is at-8), so previously translated shaders are regenerated.RDNA 2 defines the two-input binary32 and binary16 ordering in §12.7 (pp. 132–133 and 136). Min3 and max3 compose those operations (§12.12, p. 170). The packed definitions specify per-half min/max (§12.10, p. 164). The median description has no separate mixed-zero rule, so the fixture applies the same ordering to the median. DXIL FMin and FMax permit either input when the operands compare equal. AMD RDNA 2 ISA, DXIL operation reference
Before and after
The baseline used the translators at
150c625ae9b0c0f48d50f44d77899cc18291d2ec. Each adapter produced 252 result words across the offline pixel (DXCps_6_2) and startup (DXCps_6_0and FXCps_5_1) paths. The table gives mismatches against the independent reference. Each offline draw also checks all 4,096 rendered pixels.Each cell below contains four hexadecimal words in readback order. The first two two-input lanes place
(-0, +0)and(+0, -0)in order, followed by two negative zeros and two positive zeros. The three-input mixed rows repeat the two mixed pairs with a trailing-1and then+2. The all-zero rows use(-0,-0,+0),(+0,+0,-0),(-0,+0,+0)and(+0,-0,-0). The packed rows swap both half-lane orders.00000000 80000000 80000000 0000000080000000 80000000 80000000 0000000000000000 80000000 80000000 0000000000000000 00000000 80000000 00000000bf800000 bf800000 00000000 80000000bf800000 bf800000 80000000 80000000bf800000 bf800000 80000000 00000000bf800000 bf800000 80000000 8000000000000000 80000000 40000000 4000000000000000 00000000 40000000 4000000080000000 00000000 40000000 4000000000000000 00000000 40000000 4000000000000000 80000000 00000000 8000000080000000 80000000 00000000 0000000000000000 80000000 00000000 80000000/80000000 00000000 80000000 0000000080000000 80000000 80000000 8000000000000000 80000000 00000000 80000000/80000000 00000000 80000000 0000000000000000 00000000 00000000 0000000000000000 80000000 00000000 8000000080000000 00000000 00000000 8000000080000000 00008000 80000000 0000800080008000 80008000 80000000 0000800080000000 00008000 80000000 0000800000000000 00000000 80000000 00008000Single quiet NaN rows matched before and after on both adapters. For median with
(-1, +2, qNaN), the pixel path returnedbf800000and the startup path returned40000000, preserving their existing policies.Limits
The fixture covers the float min/max encodings already lowered by these two translators. Plain scalar and three-input binary16 min/max and the startup SDWA variants remain unsupported. Median and packed zero ordering were tested on desktop adapters. Console hardware, signaling NaNs and NaN payload propagation were unmeasured.
Verification
Tested commit
e6560f186ee6228ba2f497d4d48468f43dcef944.Windows 10 22H2, build 19045.6456. NVIDIA GeForce GTX 1060 6GB, driver 32.0.15.6094. In-box Microsoft Basic Render Driver (WARP), driver 10.0.19041.5794. DXC 1.9.2602.17, FXC 10.0.26100.9457, LLVM 15.0.7. D3D12 debug layer enabled, with zero errors and warnings in the signed-zero draws.
dev)release)The Debug totals count each selected test once, incorporating focused reruns after updating the existing pixel assertions and the new fixture's readback extent check. Both shader controls ran with the Debug renderer. The first changed word on WARP with plain min/max was the first output of offline f32 min, which returned
00000000in place of80000000. The hardware GPU check has a capability skip (77) for systems without a D3D12-capable adapter.The CPU checks reject both mutations across all 20 translator/encoding combinations. The LLVM 15 check reassembles the recorded instruction words.
Set
VULKAN_SDKto the Vulkan SDK 1.4.363.0 installation and make the Windows SDK shader compilers available. Use a Python environment withrequirements-dev.txtinstalled.The focused Debug reruns used
^shader_signed_zero_minmax_|^pixel_aot_(three_way_)?(warp|hardware)$and then^shader_signed_zero_minmax_as the CTest filter.To measure the baseline, run the same fixture with
beforein place of$modeagainst the base translators.I reran the same
$testsselection on the same machine, ate6560f18: 65/65 in dev and 65/65 in release on the GTX 1060 and WARP, with the debug layer on and no skips.After merging main and moving the cache revision to 7 (head
c56a2485), the Debug selection^shader_signed_zero_minmax_|^startup_gfx2hlsl_|^pixel_aot_(three_way_)?(warp|hardware)$|^docs_links$passed 50/50. The cache-revision checksstartup_image_sample_a16_check.pyandstartup_image_load_mip_check.pypass too.AI-assisted (Codex, driven with Claude Code; Claude Code reviewed the change and reran the selection).
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T23:42:17Z.
Ran it, broke the helper five ways — all caught — and checked the signed-zero table by bit pattern
Read on the merge base (
8ec25533, 28 commits behind), so the real shape is 10 files / 368 lines rather than the 2 000-plus thatgit diff origin/mainshows.tools/shader_minmax.py&↔|)either == 0u(only both-+0recognised)max/minmaxuseseitherlikeminminusesa_bits & b_bitslikemaxThe second one is the subtle one:
(either & 0x7fffffffu) == 0uandeither == 0udiffer only when both operands are zero and at least one carriesthe sign bit — and it is caught, so your fixture includes a
(-0, -0)or(+0, -0)pair rather than only(+0, +0).The table, checked against the ISA order over the corner values
I transcribed
minmax_zero32and compared bit patterns (not==, which cannot distinguish the two zeros) with a reference that reads the signfrom the bit pattern:
so
max(-0,+0) = +0,min(-0,+0) = -0, and the equal-sign cases keep their sign — the ordering the ISA section you cite gives, and the opposite ofwhat a naïve
fmax/fminwould produce for the mixed pair on most hardware.Exactly-one-zero must not take the special path, and it does not:
That last line is the interesting one:
max(-0, -1) = -0, not1e-45-style constant folding, and the helper reaches it through the normalmaxbranch rather than the zero branch, which is the correct route.
A mistake I made while checking this, recorded because it is instructive
My first reference implementation used
a < 0to detect negative zero. That is wrong in Python and in HLSL:-0.0 < 0.0is false, because thecomparison is numeric and the two zeros are equal. It flagged four false mismatches before I switched to
copysign/bit inspection. Anyone writing asigned-zero test will hit this; the fixture needs bit comparison, not
==.What I could not check
The claim that keeping the selection in
asuintstops the compiler from merging the two float zeros. Without DXC I cannot show the generated assemblyeither way, and it is the one part of the helper that is about the toolchain rather than the arithmetic. If you have the disassembly for one
max(-0,+0)instantiation, that sentence in the comment would stop being a claim.The
d3d12_draw.inlrevision bump (x2w-startup-shader-7) I take at face value — it is a cache key, and the fixture does not read it.Notes
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T00:44:16Z.
Thanks @ChazY11. The five mutations and the bit-pattern table are a useful cross-check, and yes, the fixture has both
(+0, -0)and(-0, -0)pairs.On the one claim you couldn't check, I compiled the helper with DXC 1.9 (
-T cs_6_0 -O3) and compared it with the obvious float-typed form, which returnsasfloat(zero)for the zero pair and otherwisemax/min. I looked at the DXIL:bitcastto i32,or/and,icmp eq (either & 0x7fffffff), 0,FMax/FMin(dx.op.binary.f3235 and 36) on the other path, and the result bitcast back to i32.bitcast i32 ... to floatand merged with theFMaxresult as a float.So at the DXIL stage both keep the zero bits; DXC doesn't merge them in either form. The code comment overstates this, and the real reason is narrower. With the integer selection there's no float-typed choice between two zeros left for the driver's backend compiler, which may treat
-0and+0as interchangeable. I haven't measured a driver that does. If you or the maintainer prefer, I'll reword the comment to say exactly that. It's inside the emitted HLSL, so that rewording also changes the pinned helper text.The cache revision only invalidates translations cached before this change; you're right that the fixture doesn't read it.
Status: ready to merge from our side. CI is green at
c56a2485, and nothing else is open on our side.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:01:56Z.
Review: COMMENTED
Review of head
c56a2485b10194903482017bafb75a4c13a88481.Verdict: no blocking findings. P1=0, P2=0.
What I checked
minmax_zero32(tools/shader_minmax.py) is integer-selected only when both operands are +/-0. Max uses AND of the sign bits, min uses OR. All other pairs, including NaN mixes, fall through to the oldmin/max, so behavior elsewhere is unchanged.FLOAT_MINMAX): offline pixel (min, max, min3, max3, med3_32, packedminmax16_num) and startup (v_min_f32,v_max_f32, min3, max3, med3).x2w-startup-shader-7insrc/startup_stubs/d3d12_draw.inl. It matches the revision the Python side hashes.CI: the Windows build and test job, the Linux Python checks and the gfx1013 assemble and translate job are all green. The /O2 job and the coverage chart job were skipped.
Commands executed locally (Linux worktree)
python3 tests/shader_signed_zero_minmax_check.py->20 signed-zero lowering checks reject both helper mutations, rc 0python3 tests/pixel_aot_check.py-> rc 0python3 tests/docs_links_check.py->Checked 18 Markdown files and 388 links.python3 tests/bidi_controls_check.py-> no bidirectional controlsgit diff --check origin/main...HEAD-> cleanMutations I tried (reverted afterwards)
tools/startup/gfx2hlsl.py, I flipped the last polarity ofv_max3_f32fromtruetofalse. The new check failed with an AssertionError onmax3, so it was killed.tools/shader_minmax.py, I changed the max zero case froma_bits & b_bitstoeither. The check failed with an AssertionError on the helper text, so it was killed.Nits (non-blocking)
med3mixed-zero ordering is not defined by the ISA. The PR already says it applies the same ordering. This is a documented choice, not a defect.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-25T03:44:39Z.
Ran it on an RX 9070 XT (driver 32.0.32029.2010), because the signed-zero rule is exactly the kind of thing that only shows on a real card:
Both compilers are covered (dxc
ps_6_0/ps_6_2and fxcps_5_1, the latter appears in the line above), and the 20 pure-Python checks reject both helper mutations.I also went back to the ISA clauses the helper rests on, and they are stronger than the "orders -0 below +0" summary you wrote — worth having in the comment of
minmax_zero32because they settle both operand orders:so min returns
-0whenever one operand is-0, and max returns+0whenever they differ — which is whateitherfor min anda & bfor max give, in both orders, andmax(-0,-0)stays-0through the else branch.V_MIN3_F32/V_MAX3_F32are described as nestedV_MIN_F32/V_MAX_F32calls, so chaining the helper is the same rule, not an approximation.Limits: AMD only, no NVIDIA card here; and a green draw says the words match your reference on this driver, not that another compiler could not reorder the two zeros again.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T04:47:50Z.
Review: COMMENTED
Re-review of head
df0dd5fa89d169e2097b3905825c7a311e29ed28(previous review was onc56a2485; the new commits are2919a123plus a main merge).Summary: no blocking issues. One doc inconsistency (P2) and two nits.
Checked (all executed locally in a review worktree)
git diff --stat origin/main...HEAD: 11 files, +376/-27. Title is neutral. PR is MERGEABLE.git merge-treeagainst currentorigin/main(5 commits ahead) is clean.python3 -B tests/shader_signed_zero_minmax_check.py->20 signed-zero lowering checks reject both helper mutations.python3 -B tests/pixel_aot_check.py->Self-test passed.python3 tests/docs_links_check.py-> 18 files, 405 links OK.python3 tests/bidi_controls_check.py-> OK.git diff --check origin/main...HEAD-> clean.binary llvm-mc-15mode could not run here (llvm-mc-15is not installed on this host). CI covers it.v_max3_f32lowering intools/startup/gfx2hlsl.pywith plainmax(max()). The test fails with an AssertionError. Killed.maximum ? (a_bits & b_bits) : eitherwitheitherintools/shader_minmax.py. The test fails. Killed. Both mutations were reverted.Logic review
minmax_zero32(tools/shader_minmax.py): for two zeros, min takes the OR of the bits and max takes the AND. This matches the ISA rule that min returns -0 if either operand is -0 and max returns +0 when the zeros differ. Equal zeros are unchanged. Non-zero and NaN inputs fall through to the native min/max. The zero test is on the masked bits, so denormals are not caught. Correct.min3/max3are nested in both translators.med3is rebuilt from the helper in both. NaN handling inmed3_32is kept. Packed binary16 goes throughminmax16_num, which keeps the NaN select. All consistent.FLOAT_MINMAXis emitted once per pixel source and once in the startupcommon(). Compute requests are still refused on main, so no compute preamble is missing the helper after the merge.x2w-startup-shader-9in bothd3d12_draw.inlandgfx2hlsl.pyand agrees withdocs/startup-runtime.md:192.Findings
docs/experiments.md:6298says the cache revision advances tox2w-startup-shader-7. The code anddocs/startup-runtime.md:192say-9. Update the doc line to-9.tools/shader_minmax.py:9hasFLOAT_MINMAX =""". Add a space before=.P1=0 P2=1
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T04:41:43Z.
@thepatrickworld, thank you for the RX 9070 XT run (0/252 words differ, with both compilers) and for pulling out the exact clauses.
2919a123puts them next toFLOAT_MINMAXintools/shader_minmax.py. It records min returning −0 when either operand is −0 and max returning +0 when the zeros differ, in both operand orders. Equal zeros take the general branch, somax(-0,-0)stays −0. It also notes thatV_MIN3/V_MAX3/V_MED3are defined through nestedV_MIN/V_MAX, so chaining the helper applies the same rule rather than an approximation. It is a Python comment outside the HLSL string, so the emitted HLSL is byte-identical.df0dd5famerges currentmain. It keeps this med3 next to main's newmul_hi_u32, and moves the startup shader cache revision tox2w-startup-shader-9in both keys and the docs, becausemainis at-8. After the merge, the signed-zero check (20 checks, both helper mutations rejected), the med3, translator, export-mask, A16, load-mip, cvt and mad checks, docs links and bidi all pass.Agreed on your limit: the hardware evidence is the original GTX 1060 6GB + WARP runs plus your RX 9070 XT. An Intel or newer NVIDIA run would still be welcome.
Status: ready to merge from our side once CI is green on
df0dd5fa.Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T05:02:43Z.
Thanks. Both fixed in
b0bab443:docs/experiments.md:6298now saysx2w-startup-shader-9, matching the code anddocs/startup-runtime.md:192.FLOAT_MINMAX = """.mul_hi_u32that main added.The signed-zero check (20 checks, both mutations rejected), docs links and
git diff --checkpass atb0bab443.Status: ready to merge from our side once CI is green.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:06:38Z.
Review: COMMENTED
Re-review of head
b0bab443dcefc694d4040f186e1626e893b333c5(previous review was ondf0dd5fa; the one new commit isb0bab443, docs and spacing only).Summary: no blocking issues. The earlier P2 and the earlier nit are both resolved.
Previous findings
docs/experiments.mdsaidx2w-startup-shader-7): resolved. Line 6298 now saysx2w-startup-shader-9. It agrees withsrc/startup_stubs/d3d12_draw.inl:210,tools/startup/gfx2hlsl.py:2711anddocs/startup-runtime.md:192.FLOAT_MINMAX ="""spacing intools/shader_minmax.py): resolved.Checked (all executed locally in a review worktree)
git diff --stat df0dd5fa..HEAD: 2 files, +2/-2 (docs/experiments.md,tools/shader_minmax.py). No logic change.python3 -B tests/shader_signed_zero_minmax_check.py->20 signed-zero lowering checks reject both helper mutations.python3 -B tests/pixel_aot_check.py-> exit 0.python3 tests/docs_links_check.py-> 18 files, 405 links OK.python3 tests/bidi_controls_check.py-> OK.git diff --check origin/main...HEAD-> clean.maximum ? (a_bits & b_bits) : eitherwitheitherintools/shader_minmax.py. The check fails with an AssertionError. Killed. Reverted withgit checkout -- ..Findings
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T06:17:56Z.
Review: COMMENTED
Re-review at head
4beb58eb04dfd2b1d226cc0cceab6ea711ba4da2(a merge of main into the branch; no change to the min/max logic since the previously reviewed headb0bab443).Findings
x2w-startup-shader-9to-8intools/startup/gfx2hlsl.pyalone is not caught byshader_signed_zero_minmax_check.pyorstartup_gfx2hlsl_mad_check.py. The Python key and thesrc/startup_stubs/d3d12_draw.inl:222constant could drift apart without a failing test. Consider a small check that both strings match.warp/hardwaredraw tests, which need Windows.Checked
tools/shader_minmax.py: the OR rule for min and the AND rule for max on two zeros match the signed-zero rule in the ISA text quoted in the file. A NaN operand skips the zero branch becauseeither & 0x7fffffff != 0, so NaN behavior is unchanged.pixel_aot.py(min, max, min3, max3, med3_32, packed f16minmax16_num) andgfx2hlsl.py(v_min/max_f32, min3/max3, med3) all route through the helper.FLOAT_MINMAXis emitted once per shader in both translators.gfx2hlsl.pyandd3d12_draw.inl.windows.ymlregister the new test, including the warp and hardware draw variants.Commands run locally (all passed)
python3 tests/shader_signed_zero_minmax_check.py->20 signed-zero lowering checks reject both helper mutationspython3 tests/pixel_aot_check.py-> rc 0python3 tests/startup_gfx2hlsl_mad_check.py-> passpython3 tests/docs_links_check.py-> 412 links OKpython3 tests/bidi_controls_check.py-> OKgit diff --check origin/main...HEAD-> cleanshader_minmax.py. The test failed with an AssertionError, so it is killed. Reverted.-8. Not caught (see the nit). Reverted.I did not run the Windows WARP draw tests for this head, because the only change since the last review is a merge of main. The Windows CI jobs should confirm the readback tests.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T12:52:54Z.
@Jess-Doit could you rebase this branch onto current
mainand force-push?GitHub reports head
4beb58ebas conflicting withmain, so it cannot be merged as is.Files that conflict with current
main(4aaea119):docs/startup-runtime.mdsrc/startup_stubs/d3d12_draw.inltools/startup/gfx2hlsl.pyCommands run locally:
Once it is rebased and CI is green it will be re-checked right away.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T17:09:18Z.
@tedin7 thanks. Rebased onto current
main(7092683a) as one commit and force-pushed: head is now69c6db79.What changed in the rebase:
mainhad moved the startup shader cache revision to 14, so this change now advances it to 15, and the compute revision to 15cs.startup_compute_request_check.pyrequires the compute revision to follow the graphics one.startup_compute_request_offline_check.pyis recomputed with the test's own framing function.pixel_aot.pykeepsmain'sTITLE_MEMORY_X2selection and prependsFLOAT_MINMAXas before.Tests on Windows 10 build 19045,
devpreset, GTX 1060 6GB (driver 32.0.15.6094) and in-box WARP 10.0.19041.shader_signed_zero_minmax|pixel_aot_|startup_gfx2hlsl_buffer_store|startup_indirect_draw_indexed|startup_compute_request: on the first run, 185 passed, 4 were capability skips and 2 failed.startup_compute_request_warpfailed on the revision rule above. It passes after the fix, along with the other revision-dependent tests.pixel_aot_title_loads_warpfails here, and fails the same way onmainon this host's WARP.shader_signed_zero_minmax_check,startup_gfx2hlsl_buffer_store_check,startup_compute_request_offline_check,docs_links_checkandbidi_controls_checkpass.Ready to merge from our side.
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T22:01:13Z.
Rebased onto current
main(0104f763) as one commit and force-pushed: head is now706767ac.Revision: #2010 moved the startup shader cache revision to 16, so this change now advances it to 17.
x2w-startup-mesh-57-3, because mesh uses the same shared min/max lowering. #2010 advanced it for the same reason.startup_indirect_draw_indexed.cpp,startup_resource_retire_title.cpp,startup_gfx2hlsl_buffer_store_check.pyandstartup_gfx2hlsl_fract_check.pyare updated, and so are the docs.0x8421b8080fd0a5e6).fract32from #2010 and this PR's signed-zeromed3are both kept in the shared preamble.Tests on Windows 10 19045, GTX 1060 + WARP,
ctest -R "minmax|signed_zero|compute_request|indirect_draw|gfx2hlsl|pixel_aot|fract|resource_retire|mesh":main0104f763on the same host:pixel_aot_title_loads_warp,startup_gfx2hlsl_f32_sdwa_warp(WARP denormal behaviour) andstartup_resource_retire_title_hardware_debug0/debug1.shader_signed_zero_minmax_check.py(20 mutation checks) andstartup_compute_request_offline_check.pypass.Ready to merge from our side.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-25T22:51:23Z.
Heads-up, because the numbers moved under this branch.
#2095 merged at 21:48 as
bd53c9b6and tookx2w-startup-shader-17/17cs, somainis at 17 and this branch's17/17csnow collide with it: it needs18/18cs. Worth stating explicitly — after a rebase the two revisions look identical ingit diff, so the collision is invisible right up to the point where two different cache seeds become one.There is also a content conflict behind the number, in
tools/startup/gfx2hlsl.py: #2095 madev_med3_f32lower throughmed3_32(...)(the minimum of the three when a source is NaN), and this branch replaces that same call site withminmax_zero32(...). A rebase has to keep both behaviours, not just rename a key; themed3helper body sits in the same block.Two smaller ones.
tests/startup_gfx2hlsl_fract_check.pyhere still compares'x2w-startup-shader-15'against'16', wheremainnow has('16', '17'). And the slot 57 mesh key is untouched by our merge —mainstill carriesx2w-startup-mesh-57-2, so the move to57-3stands.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T23:34:36Z.
Rebased onto
main(cece3a36) and force-pushed: head is now25e01dc8. GitHub reports it mergeable with currentmain(780c0bc4).What changed since
706767ac:v_med3_f32NaN rule. The slot 57 mesh key isx2w-startup-mesh-57-3, and the offline compute key is re-pinned (0x375fa7c3f8f4a3dd).med3_32now has the same body astools/pixel_aot.py.minmax_zero32, so -0 sorts below +0.minmax_zero32hands a NaN to D3Dmin/max, which return the other operand, so #2095's NaN result is unchanged.startup_gfx2hlsl_f32_med3_check.pypins the new body, and its four mutations are still rejected.shader_signed_zero_minmax_check.py. The startup reference no longer keeps the old branchless median result for a NaN source. It now expects the min3 result from #2095, the same as the pixel arm.startup_gfx2hlsl_root_check.py. This test needs the valid request to sort after a bad one by key. That only held by chance at some revisions, and revision 18 broke it.main.import pixel_aotin the preamble is kept besideFLOAT_MINMAX. Onlyfma16_rnecomes from pixel_aot there, sominmax_zero32is defined once.Tests on Windows 10 19045, GTX 1060 6GB (driver 32.0.15.6094) + WARP,
ctest --preset dev -R "minmax|signed_zero|med3|f16|compute_request|indirect_draw|gfx2hlsl|fract|resource_retire|pixel_aot":shader_signed_zero_minmax_warp/_hardware,startup_gfx2hlsl_f32_med3_warp/_hardware,compute_store_aot_alu_med3_*andstartup_gfx2hlsl_rootall pass.main5ba062ebon this host. They are the sevenstartup_resource_retire_{reasons,title,views}*_hardwarearms (the four views arms segfault),startup_gfx2hlsl_f32_sdwa_warpandpixel_aot_title_loads_warp.pixel_aot_cvt_f64_f32_hardwaretimed out at its 60 s limit under-j 2, and passed in 39 s when rerun alone.Ready to merge from our side.
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-26T01:04:30Z.
Fixed the failed
Build and test on Windowsjob: head is nowa9fc952f.Cause:
startup_shader_cache_key_check.py(from #2595) pins two known-answer pipeline keys at revision 17. This PR moves the revision to 18, and my local filter didn't select that test.Fix: the two values are re-pinned for
x2w-startup-shader-18:0x8d1cb58fb148b30a, and0xf9e74efdcb8283d2with the input layout. The comment now names revision 18. The runtime literal ind3d12_draw.inlis the same revision, andstartup_indirect_draw_indexedchecks the two sides against each other.Checks:
ctest --preset pr --no-tests=error, the CI set: 38 of 38 pass on Windows 10 19045 with the GTX 1060.tests/*.pythat usespipeline_key,compute_keyor a revision literal on this branch and onmain. This test was the only one whose result differs between the two; the rest fail on both only because they need draw arguments.Ready to merge from our side.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-26T01:55:56Z.
An AMD adapter line for the table: the reference you cite is RDNA 2 and the rows above are WARP and a GTX 1060.
Head
a9fc952f,devpreset, Windows 11 25H2 build26200.9974, MSVC tools14.44.35207, AMD Radeon RX 9070 XT (1002:7550, driver32.0.32029.2010).All three ran and passed; the capture holds no
Skippedline and no***Failedline. The per-draw lines below come from a separate verbose re-run of test 877 (20.44 sec). It names the adapter on every draw (adapter=AMD Radeon RX 9070 XT vendor=1002 device=7550,driver=32.0.32029.2010,backend=hardware debug_layer=unavailable), and its verdict on the card is:So, on this adapter, after the change: 0 / 252. Every one of the 252 words agrees with the reference — the same cell as WARP after and as both GTX 1060 cells in the adapter table above.
I did not measure the before column on this adapter. The check is added by this PR (
tests/shader_signed_zero_minmax_check.py), so a before number would mean transplanting the fixture onto the baseline translators at150c625ae9b0; I did not do that, and I would rather leave the cell empty than fill it with a number I did not produce.Neighbouring selections, to show the change does not disturb what surrounds it — the filters the run used:
and what they reported:
Two of the four names in that second filter exist in the suite;
rootis the line the capture kept.The hardware run reports
debug_layer=unavailable, so the adapter result carries no validation-layer output.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T02:15:56Z.
Merged current
maininto the branch (merge commit04f26e56, no rebase, no force). The PR was 56 commits behind. The merge had no conflicts and I changed no code.The shader cache revision is still 18 here and 17 on
main. No test onmainpins revision 17, so nothing else needed re-pinning.Commands executed locally
tests/*.pythat mentions a cache revision,pipeline_key,compute_key, min/max or med3. They pass, apart from 9 that need draw arguments and fail the same way on a cleanmain.shader_signed_zero_minmax_warp,startup_gfx2hlsl_f32_med3_warp,startup_gfx2hlsl_root,startup_shader_cache_keyandstartup_indirect_draw_indexed_warpall passed.pixel_aot_compare_lod_{level,bias}_{warp,hardware}:offscreen_check.exewas stale and did not know--check-pixel-compare-level. After rebuildingoffscreen_check, all 4 pass in dev and release.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:40:28Z.
Review: COMMENTED
Review at head
c1689a59(main merged into the branch since the previously reviewed head4beb58eb; the min/max logic is unchanged).Findings
Checked
4beb58ebthe only PR-specific change is the update of the four mutations intests/startup_gfx2hlsl_float_alu_check.py(v_min_f32,v_max_f32,v_min3_f32,v_max3_f32). They match theminmax_zero32text and flip the same operation as before, so each mutation still changes a draw set.tools/startup/gfx2hlsl.pyand insrc/startup_stubs/d3d12_draw.inl. Nox2w-startup-shader-17literal is left intools,srcortests.shader_signed_zero_minmax_warp,startup_gfx2hlsl_f32_med3_warp,startup_gfx2hlsl_float_alu_warp). The Win2025 receipt for this head is on the PR.-9versus-8is no longer relevant: the revision is now 18 andstartup_shader_cache_key_check.pypins it.Commands run locally (all passed)
python3 tests/shader_signed_zero_minmax_check.py->20 signed-zero lowering checks reject both helper mutationspython3 tests/startup_gfx2hlsl_float_alu_check.py,tests/pixel_aot_check.py,tests/startup_shader_cache_key_check.py-> rc 0python3 tests/docs_links_check.py,python3 tests/bidi_controls_check.py-> rc 0git diff --check origin/main...HEAD-> cleantools/shader_minmax.pyfrom0x7fffffffto0x7ffffffe. The signed-zero check failed, so it is killed. Reverted.ctestselection of 237 tests, 237 passed.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-26T03:15:20Z.
Thanks @tedin7 for the merge and the Windows Server 2025 run, and @thepatrickworld for the RX 9070 XT result (0 / 252). That gives an RDNA cell next to WARP and the GTX 1060.
mainmoved 26 commits past04f26e56, so I merged currentmain(d41a9a80) on top of your merge rather than rebasing. Head is now7949526d, and GitHub reports it mergeable withmain47ffb877.The conflict and two follow-ups:
pipeline_keyintools/startup/gfx2hlsl.py. #2592 added theps_inputsmask hash. Their version is kept, with the seed atx2w-startup-shader-18.tests/startup_packed_position_provenance_check.py(#2592) spells the bare key at revision 17. It now says 18.tests/startup_gfx2hlsl_float_alu_check.py(#1712). Its references are unchanged: its docstring leaves signed-zero ordering out of scope. Four of its mutation patterns matched the old emittedU(min(/U(max(text, which this PR replaces withminmax_zero32.v_min_f32andv_max_f32, and the outer min/max forv_min3_f32andv_max3_f32.v_med3_f32pattern already matchedmed3_32(.Checks:
tests/*.pythat names min/max/med3, a cache key or a revision gives the same result on this branch and onmain. The only exception isshader_signed_zero_minmax_check.py, which this PR adds.ctest --preset pr --no-tests=error: 38 of 38 pass.startup_gfx2hlsl_float_alu_{controls,warp,hardware}pass, and so doshader_signed_zero_minmax_*andstartup_gfx2hlsl_f32_med3_*.mainhere: the sevenstartup_resource_retire_{reasons,title,views}*_hardwarearms,startup_gfx2hlsl_f32_sdwa_warpandpixel_aot_title_loads_warp.startup_gfx2hlsl_float_transcendental_hardwarefrom #1745. On the GTX 1060 the FXCv_log_f32draw readsc03ffffffor log2(0.125), wherec0400000is expected: one ulp off -3.0. That test uses no min, max or med3.Ready to merge from our side.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:39:26Z.
Win2025 WARP receipt for head
c1689a59after updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
c1689a5984d94df6d61d8c438d1d65ef08b5e79e:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check startup_indirect_draw_indexed startup_resource_retire_title offscreen_check -- -j 2):59.62s(configure2.47s)ctest --preset dev -R 'minmax|signed_zero|med3|pixel_aot|fract|float_alu|shader_cache_key|indirect_draw|gfx2hlsl_root|compute_request' --parallel 4 --no-tests=error --output-on-failure): 233/237 passed (197.03s:pixel_aot_three_way_warp15.69s,pixel_aot_core_vector_warp18.18s,pixel_aot_warp19.17s,pixel_aot_bits_warp24.90s,pixel_aot_buffer_color_warp10.39s,pixel_aot_predicate_rounding_warp10.15s,pixel_aot_comparisons_warp7.53s,pixel_aot_cmpx_regions_warp6.82s,pixel_aot_compare_warp22.18s,pixel_aot_blend_scalar_warp11.54s,pixel_aot_bits_hardware9.12s,pixel_aot_compare_hardware22.07s,pixel_aot_cvt_f64_f32_warp11.21s,pixel_aot_hardware9.26s,pixel_aot_cvt_int_f64_warp8.97s,pixel_aot_e64_warp5.84s,pixel_aot_blend_scalar_hardware7.39s,pixel_aot_comparisons_hardware7.41s,startup_gfx2hlsl_float_alu_hardware14.48s,pixel_aot_buffer_color_hardware6.52s,startup_gfx2hlsl_float_alu_warp14.79s,pixel_aot_f16_arith_warp8.60s,pixel_aot_three_way_hardware7.38s,pixel_aot_core_vector_hardware8.71s,pixel_aot_cvt_f64_f32_hardware11.41s,pixel_aot_cmpx_regions_hardware11.23s,pixel_aot_cmpx_e64_warp5.92s,pixel_aot_cvt_flr_rpi_warp5.09s,pixel_aot_gather_warp4.14s,pixel_aot_compare_gather_warp3.91s,shader_signed_zero_minmax_warp7.25s,pixel_aot_exec_regions_warp5.06s,shader_signed_zero_minmax_hardware7.47s,pixel_aot_e64_hardware5.45s,compute_store_aot_alu_minmax3_hardware2.24s,pixel_aot_sample_coarse_gradient_hardware3.28s,pixel_aot_cmp_f64_warp4.68s,pixel_aot_cmpx_e64_hardware5.51s,pixel_aot_sample_gradient_hardware3.09s,pixel_aot_f16_arith_hardware4.67s,pixel_aot_cvt_flr_rpi_hardware4.88s,pixel_aot_f16_round_warp3.42s,pixel_aot_cvt_f64_int_warp3.92s,pixel_aot_compare_sample_warp3.86s,compute_store_aot_alu_med3_hardware1.88s,pixel_aot_u32_from_f32_warp1.65s,pixel_aot_cmp64_warp3.43s,pixel_aot_compare_gather_hardware4.07s,pixel_aot_sample_lod_warp2.05s,pixel_aot_dpp_f16_warp5.17s,pixel_aot_shift64_warp4.71s,compute_store_aot_mimg_atomic_minmax_hardware1.98s,pixel_aot_predicate_rounding_hardware4.98s,pixel_aot_f16_fmac_ldexp_warp3.10s,pixel_aot_sample_coarse_gradient_warp3.42s,compute_store_aot_alu_minmax3_warp2.31s,pixel_aot_exec_regions_hardware5.13s,compute_store_aot_alu_med3_warp1.87s,pixel_aot_cvt_int_f64_hardware5.45s,compute_store_aot_mimg_atomic_minmax_warp2.18s,pixel_aot_u32_from_f32_hardware1.79s,pixel_aot_sample_gradient_warp3.15s,pixel_aot_gather_hardware4.27s,pixel_aot_sample_offset_warp2.71s,pixel_aot_dpp_f16_hardware5.48s,pixel_aot_cmp_f64_hardware5.00s,pixel_aot_cmp64_hardware4.14s,pixel_aot_dpp_cvt_hardware2.22s,pixel_aot_dmask_warp2.13s,pixel_aot_dpp_extra_warp3.07s,pixel_aot_rndne_warp1.96s,pixel_aot_get_lod_warp2.05s,pixel_aot_compare_sample_hardware4.02s,pixel_aot_shift64_hardware4.84s,pixel_aot_f16_round_hardware3.50s,pixel_aot_cvt_f64_int_hardware3.80s,pixel_aot_attribute_warp1.48s,pixel_aot_int16_ternary_warp3.44s,pixel_aot_s_call_hardware1.51s,startup_compute_request_warp3.76s,pixel_aot_dpp_extra_hardware2.61s,pixel_aot_f16_cvt_int16_warp2.50s,pixel_aot_f16_fmac_ldexp_hardware2.66s,pixel_aot_attribute_hardware1.17s,pixel_aot_f16_exact_extra_warp3.07s,pixel_aot_sample_offset_hardware2.49s,pixel_aot_int16_ternary_hardware2.96s,pixel_aot_mac_legacy_hardware1.48s,pixel_aot_f16_exact_extra_hardware3.07s,pixel_aot_region_body_warp2.37s,pixel_aot_get_lod_hardware2.28s,pixel_aot_sdwa_movrel_hardware1.71s,pixel_aot_scc_skip_hardware2.01s,pixel_aot_sdwa_f16_warp2.85s,pixel_aot_sdwa_f16_hardware2.74s,pixel_aot_dpp_cvt_warp2.05s,pixel_aot_sad_hardware1.41s,pixel_aot_f16_cvt_int16_hardware2.56s,pixel_aot_scc_skip_warp1.94s,pixel_aot_region_scalar_load_hardware1.66s,pixel_aot_cvt_float_int_e64_warp2.10s,pixel_aot_cvt_f32_f64_warp2.00s,pixel_aot_sample_lod_hardware2.21s,pixel_aot_region_body_hardware2.42s,pixel_aot_rndne_hardware2.06s,pixel_aot_dmask_hardware2.06s,pixel_aot_int16_vop3_warp1.88s,pixel_aot_sdwa_cvt_hardware2.58s,pixel_aot_sdwa_cvt_warp2.59s,pixel_aot_title_loads_hardware2.65s,pixel_aot_pk_fmac_warp1.76s,pixel_aot_region_scalar_load_warp1.83s,pixel_aot_sample_clamp_compile2.57s,pixel_aot_sdwa_int_extra_warp2.44s,pixel_aot_carry_in_warp1.52s,pixel_aot_f16_to_int16_warp1.83s,pixel_aot_plain_movrel_warp1.83s,pixel_aot_bitset64_warp2.04s,pixel_aot_div_fmas_warp1.62s,pixel_aot_sdwa_int_extra_hardware2.41s,pixel_aot_vop3_ternary_int_warp2.17s,pixel_aot_region_waits_hardware1.43s,pixel_aot_compare_lod_bias_warp2.62s,pixel_aot_plain_bitscan_warp1.81s,pixel_aot_cvt_float_int_e64_hardware2.11s,pixel_aot_swap_warp1.42s,pixel_aot_align_warp2.51s,pixel_aot_compare_lod_bias_hardware2.61s,pixel_aot_vop3_ternary_int_hardware1.96s,pixel_aot_mac_legacy_warp1.52s,pixel_aot_sdwa_unary_warp1.41s,pixel_aot_cvt_f32_f64_hardware2.28s,pixel_aot_compare_lod_level_hardware2.62s,pixel_aot_s_call_warp1.34s,pixel_aot_align_hardware2.13s,pixel_aot_compare_lod_level_warp2.51s,pixel_aot_int16_vop3_hardware2.09s,pixel_aot_bitset64_hardware2.19s,pixel_aot_uncompressed_export_warp1.47s,pixel_aot_flat_scratch_warp1.81s,pixel_aot_dpp_movrel_hardware1.61s,pixel_aot_first_bit_warp1.92s,pixel_aot_f16_to_int16_hardware1.96s,pixel_aot_plain_movrel_hardware1.97s,pixel_aot_pk_fmac_hardware1.75s,pixel_aot_sdwa_movrel_warp1.74s,mesh_entry_cvt_minmax_draw_warp1.79s,pixel_aot_smovrel_warp1.45s,pixel_aot_dpp_movrel_warp1.49s,pixel_aot_mad64_warp1.61s,pixel_aot_bfm_warp1.34s,pixel_aot_plain_bitscan_hardware1.91s,pixel_aot_sdwa_unary_hardware1.47s,pixel_aot_e64_integer_warp1.40s,pixel_aot_title_loads_warp2.72s,pixel_aot_sdwa_integer_warp1.54s,pixel_aot_region_waits_warp1.34s,pixel_aot_brev_warp1.31s,pixel_aot_e64_spellings_warp1.61s,pixel_aot_swaprel_warp1.26s,pixel_aot_sdwa_cmp_warp1.35s,pixel_aot_uncompressed_integer_export_warp1.53s,pixel_aot_first_bit_hardware1.82s,pixel_aot_region_scalar_alu_warp1.39s,pixel_aot_flat_scratch_hardware1.86s,pixel_aot_sad_warp1.45s,pixel_aot_div_fmas_hardware2.03s,pixel_aot_carry_out_warp1.67s,pixel_aot_integer_nc_warp1.46s,pixel_aot_frexp_exp_warp1.61s,pixel_aot_e64_spellings_hardware1.37s,pixel_aot_sdwa_integer_hardware1.48s,pixel_aot_smovrel_hardware1.23s,pixel_aot_pack_int16_warp1.14s,pixel_aot_e64_approx_warp1.12s,mesh_entry_cvt_minmax_draw_hardware1.60s,pixel_aot_uncompressed_integer_export_hardware1.26s,pixel_aot_ds_swizzle_warp1.28s,pixel_aot_sdwa_cmp_hardware1.69s,pixel_aot_carry_in_hardware1.55s,pixel_aot_brev_hardware1.46s,pixel_aot_sdwa_int_compare_warp1.67s,pixel_aot_compressed_export_warp1.01s,pixel_aot_mad64_hardware1.54s,pixel_aot_sdwa_int_compare_hardware1.54s,pixel_aot_swap_hardware1.41s,pixel_aot_pack_b32_warp1.19s,pixel_aot_smem_pointers_warp1.21s,pixel_aot_swaprel_hardware1.33s,pixel_aot_e64_integer_hardware1.36s,pixel_aot_carry_out_hardware1.40s,pixel_aot_uncompressed_export_hardware1.37s,pixel_aot_frexp_exp_hardware1.49s,pixel_aot_region_scalar_alu_hardware1.26s,pixel_aot_sopk_hwreg_warp1.10s,pixel_aot_vop1_nops_warp1.04s,pixel_aot_integer_nc_hardware1.21s,pixel_aot_bfm_hardware1.22s,pixel_aot_compressed_export_hardware1.08s,pixel_aot_ds_swizzle_hardware1.16s,pixel_aot_e64_approx_hardware0.92s,pixel_aot_pack_int16_hardware1.28s,pixel_aot_smem_pointers_hardware1.24s,pixel_aot_sopp_round_mode_warp1.15s,pixel_aot_vop1_nops_hardware0.87s,pixel_aot_pack_b32_hardware1.08s,pixel_aot_sopk_hwreg_hardware1.31s,pixel_aot_sample_clamp_controls1.35s,startup_gfx2hlsl_root1.32s,pixel_aot_sopp_round_mode_hardware1.35s,startup_gfx2hlsl_f32_med3_warp1.07s,pixel_aot_attribute_sampled_warp1.10s,startup_shader_cache_key0.97s,pixel_aot_attribute_sampled_hardware1.00s,startup_gfx2hlsl_f32_med3_hardware0.87s,startup_gfx2hlsl_fract_draw_hardware0.81s,startup_gfx2hlsl_fract_draw_warp0.79s,cpu_aot_avx_int_minmax_mul0.44s,cpu_aot_avx_int_ymm_minmax0.72s,startup_compute_request_offline0.82s,startup_compute_lds_dual_atomics_a-swap-minmax_hardware0.44s,startup_compute_lds_dual_atomics_a-swap-minmax_warp0.47s,shader_signed_zero_minmax_controls0.39s,startup_gfx2hlsl_f32_med3_controls0.31s,startup_gfx2hlsl_float_alu_controls0.40s,startup_indirect_draw_indexed_warp0.16s,startup_gfx2hlsl_int_med3_controls0.22s,startup_compute_request_disabled_control0.29s,startup_indirect_draw_indexed_hardware0.05s,startup_gfx2hlsl_fract0.31s,startup_indirect_draw_warp0.13s,startup_indirect_draw_hardware0.05s,spirv_minlod_fractional_hardware0.09s,spirv_minlod_fractional_warp0.10s,startup_gfx2hlsl_fract_draw_controls0.30s,pixel_aot_sample_clamp_hardware4.01s,pixel_aot_sample_clamp_warp4.07s); skipped (capability, not a pass):startup_indirect_draw_indexed_hardware,startup_indirect_draw_hardware,spirv_minlod_fractional_hardware,spirv_minlod_fractional_warp/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check startup_indirect_draw_indexed startup_resource_retire_title offscreen_check -- -j 2):202.39s(configure4.44s)ctest --preset release -R 'minmax|signed_zero|med3|pixel_aot|fract|float_alu|shader_cache_key|indirect_draw|gfx2hlsl_root|compute_request' --parallel 4 --no-tests=error --output-on-failure): 233/237 passed (188.53s:pixel_aot_three_way_warp14.20s,pixel_aot_core_vector_warp20.17s,pixel_aot_warp20.58s,pixel_aot_bits_warp20.65s,pixel_aot_buffer_color_warp7.12s,pixel_aot_predicate_rounding_warp5.00s,pixel_aot_comparisons_warp7.30s,pixel_aot_cmpx_e64_warp5.22s,pixel_aot_cmpx_regions_warp6.68s,pixel_aot_compare_warp19.28s,pixel_aot_compare_hardware19.36s,pixel_aot_cvt_f64_f32_warp10.71s,pixel_aot_hardware9.08s,pixel_aot_blend_scalar_warp7.18s,pixel_aot_comparisons_hardware7.27s,startup_gfx2hlsl_float_alu_warp14.49s,pixel_aot_bits_hardware9.29s,pixel_aot_cmpx_regions_hardware10.73s,startup_gfx2hlsl_float_alu_hardware14.47s,pixel_aot_compare_gather_warp4.35s,pixel_aot_exec_regions_warp5.20s,pixel_aot_core_vector_hardware4.84s,pixel_aot_cvt_f64_f32_hardware7.10s,shader_signed_zero_minmax_warp12.61s,pixel_aot_buffer_color_hardware7.72s,pixel_aot_blend_scalar_hardware16.47s,shader_signed_zero_minmax_hardware16.81s,pixel_aot_three_way_hardware7.64s,pixel_aot_dpp_f16_hardware9.23s,pixel_aot_region_body_warp2.23s,pixel_aot_cvt_flr_rpi_warp4.73s,pixel_aot_f16_arith_warp4.48s,pixel_aot_e64_warp5.13s,compute_store_aot_mimg_atomic_minmax_hardware2.01s,compute_store_aot_alu_minmax3_hardware2.26s,compute_store_aot_alu_med3_hardware1.76s,pixel_aot_sample_lod_warp2.27s,pixel_aot_cvt_int_f64_hardware4.74s,pixel_aot_dpp_extra_warp2.71s,pixel_aot_sample_coarse_gradient_warp3.15s,pixel_aot_f16_round_warp3.25s,pixel_aot_compare_sample_warp3.77s,pixel_aot_e64_hardware4.97s,pixel_aot_cmpx_e64_hardware4.96s,compute_store_aot_alu_minmax3_warp2.26s,pixel_aot_dpp_extra_hardware2.68s,pixel_aot_exec_regions_hardware4.78s,pixel_aot_cvt_int_f64_warp4.67s,pixel_aot_sdwa_cvt_hardware2.37s,pixel_aot_region_waits_warp1.34s,compute_store_aot_mimg_atomic_minmax_warp1.94s,pixel_aot_f16_arith_hardware4.23s,pixel_aot_sample_coarse_gradient_hardware3.20s,pixel_aot_dpp_f16_warp4.82s,pixel_aot_dpp_cvt_warp2.10s,compute_store_aot_alu_med3_warp1.78s,pixel_aot_cmp_f64_warp4.23s,pixel_aot_predicate_rounding_hardware4.58s,pixel_aot_sample_gradient_warp3.22s,pixel_aot_cvt_flr_rpi_hardware4.55s,pixel_aot_gather_warp4.15s,pixel_aot_get_lod_warp2.23s,pixel_aot_gather_hardware4.36s,pixel_aot_sample_offset_warp2.55s,pixel_aot_compare_gather_hardware4.17s,pixel_aot_f16_round_hardware3.20s,pixel_aot_compare_sample_hardware3.75s,pixel_aot_shift64_warp3.88s,pixel_aot_cmp_f64_hardware3.95s,pixel_aot_f16_fmac_ldexp_warp2.72s,pixel_aot_cvt_f64_int_hardware3.39s,pixel_aot_cvt_f64_int_warp3.31s,pixel_aot_shift64_hardware3.93s,pixel_aot_sdwa_f16_warp2.85s,pixel_aot_attribute_warp1.33s,pixel_aot_cmp64_warp2.95s,pixel_aot_sample_gradient_hardware3.29s,pixel_aot_dmask_warp2.01s,pixel_aot_f16_exact_extra_warp3.06s,pixel_aot_u32_from_f32_warp1.51s,pixel_aot_sdwa_f16_hardware2.73s,pixel_aot_int16_ternary_warp2.54s,pixel_aot_region_scalar_load_hardware1.71s,pixel_aot_f16_cvt_int16_warp2.47s,pixel_aot_f16_fmac_ldexp_hardware2.87s,startup_compute_request_warp2.81s,pixel_aot_plain_movrel_warp1.64s,pixel_aot_vop3_ternary_int_warp1.82s,pixel_aot_sdwa_int_extra_warp2.19s,pixel_aot_uncompressed_integer_export_warp1.23s,pixel_aot_sdwa_int_extra_hardware2.09s,pixel_aot_cmp64_hardware2.73s,pixel_aot_cvt_float_int_e64_warp1.74s,pixel_aot_sdwa_cvt_warp2.39s,pixel_aot_scc_skip_warp1.82s,pixel_aot_scc_skip_hardware1.79s,pixel_aot_dpp_movrel_warp1.41s,pixel_aot_int16_ternary_hardware2.57s,pixel_aot_pk_fmac_warp1.65s,pixel_aot_compressed_export_warp1.13s,pixel_aot_dpp_cvt_hardware2.26s,pixel_aot_rndne_warp1.97s,pixel_aot_compare_lod_level_warp2.57s,pixel_aot_compare_lod_bias_hardware2.47s,pixel_aot_f16_exact_extra_hardware3.01s,pixel_aot_cvt_f32_f64_hardware2.04s,pixel_aot_sample_clamp_compile2.62s,pixel_aot_cvt_f32_f64_warp2.01s,pixel_aot_sample_offset_hardware2.53s,pixel_aot_region_body_hardware2.28s,pixel_aot_f16_cvt_int16_hardware2.48s,pixel_aot_region_scalar_load_warp1.78s,pixel_aot_f16_to_int16_warp1.79s,pixel_aot_int16_vop3_warp1.85s,pixel_aot_title_loads_hardware2.42s,pixel_aot_swaprel_warp1.24s,pixel_aot_get_lod_hardware2.20s,pixel_aot_bitset64_warp1.80s,pixel_aot_vop3_ternary_int_hardware1.90s,pixel_aot_sdwa_integer_warp1.48s,pixel_aot_sdwa_movrel_hardware1.39s,pixel_aot_uncompressed_export_warp1.25s,pixel_aot_div_fmas_warp1.70s,pixel_aot_sample_lod_hardware2.27s,pixel_aot_compare_lod_bias_warp2.26s,pixel_aot_rndne_hardware2.03s,pixel_aot_align_warp1.77s,pixel_aot_bitset64_hardware1.52s,pixel_aot_compare_lod_level_hardware2.42s,pixel_aot_cvt_float_int_e64_hardware1.99s,pixel_aot_plain_bitscan_warp1.63s,pixel_aot_int16_vop3_hardware1.87s,pixel_aot_flat_scratch_warp1.64s,pixel_aot_title_loads_warp2.48s,pixel_aot_u32_from_f32_hardware1.50s,pixel_aot_first_bit_warp1.66s,pixel_aot_sdwa_movrel_warp1.55s,pixel_aot_ds_swizzle_warp0.94s,pixel_aot_sad_warp1.37s,pixel_aot_align_hardware1.84s,pixel_aot_mad64_warp1.44s,pixel_aot_carry_in_warp1.42s,pixel_aot_mad64_hardware1.39s,pixel_aot_brev_warp1.33s,pixel_aot_region_scalar_alu_warp1.35s,pixel_aot_pk_fmac_hardware1.70s,pixel_aot_smovrel_warp1.30s,pixel_aot_plain_movrel_hardware1.80s,pixel_aot_dmask_hardware2.04s,pixel_aot_dpp_movrel_hardware1.53s,pixel_aot_smovrel_hardware1.55s,pixel_aot_swap_warp1.45s,pixel_aot_frexp_exp_warp1.52s,pixel_aot_e64_spellings_warp1.47s,mesh_entry_cvt_minmax_draw_warp1.65s,pixel_aot_sdwa_cmp_warp1.25s,pixel_aot_s_call_hardware1.32s,pixel_aot_s_call_warp1.23s,pixel_aot_sdwa_unary_warp1.37s,pixel_aot_mac_legacy_warp1.42s,pixel_aot_f16_to_int16_hardware1.88s,pixel_aot_carry_out_warp1.30s,pixel_aot_plain_bitscan_hardware1.69s,pixel_aot_first_bit_hardware1.70s,pixel_aot_e64_integer_warp1.29s,pixel_aot_attribute_sampled_warp0.94s,pixel_aot_sad_hardware1.30s,pixel_aot_div_fmas_hardware1.57s,pixel_aot_flat_scratch_hardware1.62s,mesh_entry_cvt_minmax_draw_hardware1.59s,pixel_aot_pack_int16_warp1.19s,pixel_aot_carry_in_hardware1.41s,pixel_aot_bfm_warp1.22s,pixel_aot_smem_pointers_warp1.12s,pixel_aot_e64_approx_warp1.13s,pixel_aot_integer_nc_warp1.26s,pixel_aot_pack_b32_warp1.19s,pixel_aot_pack_int16_hardware1.56s,pixel_aot_vop1_nops_warp1.12s,pixel_aot_e64_spellings_hardware1.78s,pixel_aot_sopp_round_mode_warp1.40s,pixel_aot_brev_hardware1.43s,pixel_aot_sdwa_int_compare_warp1.53s,pixel_aot_sopk_hwreg_warp1.27s,pixel_aot_frexp_exp_hardware2.35s,startup_gfx2hlsl_root1.27s,pixel_aot_swap_hardware1.78s,pixel_aot_carry_out_hardware1.57s,pixel_aot_mac_legacy_hardware1.47s,pixel_aot_uncompressed_export_hardware1.36s,pixel_aot_sdwa_integer_hardware1.53s,pixel_aot_sdwa_unary_hardware1.36s,pixel_aot_bfm_hardware1.28s,pixel_aot_sdwa_int_compare_hardware1.38s,pixel_aot_sdwa_cmp_hardware1.46s,pixel_aot_uncompressed_integer_export_hardware1.32s,pixel_aot_attribute_hardware1.27s,pixel_aot_region_scalar_alu_hardware1.38s,pixel_aot_compressed_export_hardware1.22s,pixel_aot_region_waits_hardware1.36s,pixel_aot_pack_b32_hardware1.10s,pixel_aot_e64_integer_hardware1.04s,pixel_aot_ds_swizzle_hardware1.15s,pixel_aot_smem_pointers_hardware1.22s,pixel_aot_integer_nc_hardware1.20s,pixel_aot_swaprel_hardware1.19s,pixel_aot_sample_clamp_controls1.09s,pixel_aot_sopk_hwreg_hardware1.15s,pixel_aot_attribute_sampled_hardware0.98s,pixel_aot_e64_approx_hardware1.17s,pixel_aot_sopp_round_mode_hardware1.16s,pixel_aot_vop1_nops_hardware1.14s,startup_gfx2hlsl_f32_med3_warp0.89s,startup_shader_cache_key0.92s,startup_compute_request_offline0.93s,startup_gfx2hlsl_f32_med3_hardware0.85s,cpu_aot_avx_int_ymm_minmax0.59s,startup_gfx2hlsl_fract_draw_warp0.80s,startup_compute_lds_dual_atomics_a-swap-minmax_hardware0.49s,startup_gfx2hlsl_fract_draw_hardware0.77s,startup_gfx2hlsl_float_alu_controls0.40s,shader_signed_zero_minmax_controls0.41s,startup_compute_lds_dual_atomics_a-swap-minmax_warp0.47s,cpu_aot_avx_int_minmax_mul0.50s,startup_gfx2hlsl_f32_med3_controls0.30s,startup_gfx2hlsl_int_med3_controls0.20s,startup_compute_request_disabled_control0.24s,startup_indirect_draw_indexed_warp0.12s,startup_gfx2hlsl_fract0.32s,startup_indirect_draw_warp0.13s,startup_indirect_draw_indexed_hardware0.03s,startup_indirect_draw_hardware0.04s,startup_gfx2hlsl_fract_draw_controls0.27s,spirv_minlod_fractional_hardware0.10s,spirv_minlod_fractional_warp0.10s,pixel_aot_sample_clamp_hardware4.50s,pixel_aot_sample_clamp_warp4.20s); skipped (capability, not a pass):startup_indirect_draw_indexed_hardware,startup_indirect_draw_hardware,spirv_minlod_fractional_hardware,spirv_minlod_fractional_warptests/form_coverage_check.pyok (10.3s),tests/mesh_clip_cull_check.pyok (3.6s),tests/mesh_dynamic_geometry_check.pyok (0.2s),tests/mesh_heap_sampler_check.pyok (0.6s),tests/pso_readiness_check.pyok (0.8s),tests/rdna2_tools_check.pyok (2.1s),tests/shader_signed_zero_minmax_check.pyok (0.2s),tests/startup_buffer_address_check.pyok (0.4s),tests/startup_buffer_format_word3_table_check.pyok (0.1s),tests/startup_compute_request_offline_check.pyok (0.4s),tests/startup_compute_store_format_xyzw_check.pyok (0.2s),tests/startup_compute_translate_check.pyok (0.2s),tests/startup_flat_param_check.pyok (0.1s),tests/startup_gfx2hlsl_add_sub_co_check.pyok (0.1s),tests/startup_gfx2hlsl_add_sub_co_ci_check.pyok (0.1s),tests/startup_gfx2hlsl_bit_alu_check.pyok (0.6s),tests/startup_gfx2hlsl_capture_check.pyok (0.9s),tests/startup_gfx2hlsl_cmp16_check.pyok (0.3s),tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.pyok (31.1s),tests/startup_gfx2hlsl_compare_dst_check.pyok (0.1s),tests/startup_gfx2hlsl_compute_check.pyok (0.4s),tests/startup_gfx2hlsl_cselect_mask_check.pyok (0.1s),tests/startup_gfx2hlsl_cvt_alu_check.pyok (0.2s),tests/startup_gfx2hlsl_cvt_off_f32_i4_check.pyok (0.2s),tests/startup_gfx2hlsl_cvt_pk_int16_check.pyok (0.3s),tests/startup_gfx2hlsl_f32_lg_check.pyok (1.3s),tests/startup_gfx2hlsl_f32_nan_check.pyok (5.1s),tests/startup_gfx2hlsl_fma_mix_check.pyok (0.1s),tests/startup_gfx2hlsl_getpc_refusal_check.pyok (0.1s),tests/startup_gfx2hlsl_handler_arity_check.pyok (0.1s),tests/startup_gfx2hlsl_heap_record_check.pyok (0.2s),tests/startup_gfx2hlsl_image_arity_check.pyok (0.1s),tests/startup_gfx2hlsl_image_get_lod_check.pyok (0.2s),tests/startup_gfx2hlsl_int_med3_check.pyok (0.1s),tests/startup_gfx2hlsl_interp_p2_hi_check.pyok (0.2s),tests/startup_gfx2hlsl_join_symbols_check.pyok (0.2s),tests/startup_gfx2hlsl_loop_constants_check.pyok (0.1s),tests/startup_gfx2hlsl_mask_data_check.pyok (0.1s),tests/startup_gfx2hlsl_mask_overwrite_check.pyok (0.1s),tests/startup_gfx2hlsl_operand_count_check.pyok (0.3s),tests/startup_gfx2hlsl_pack_absdiff_check.pyok (2.6s),tests/startup_gfx2hlsl_pack_b32_f16_check.pyok (0.3s),tests/startup_gfx2hlsl_readfirstlane_recompute_check.pyok (0.1s),tests/startup_gfx2hlsl_readfirstlane_uniform_check.pyok (0.3s),tests/startup_gfx2hlsl_refusals_check.pyok (0.8s),tests/startup_gfx2hlsl_root_check.pyok (0.9s),tests/startup_gfx2hlsl_s_abs_check.pyok (0.1s),tests/startup_gfx2hlsl_s_bitset_check.pyok (0.1s),tests/startup_gfx2hlsl_s_ff0_check.pyok (0.1s),tests/startup_gfx2hlsl_s_ff1_check.pyok (0.1s),tests/startup_gfx2hlsl_s_flbit_check.pyok (0.1s),tests/startup_gfx2hlsl_s_quadmask_check.pyok (0.1s),tests/startup_gfx2hlsl_sad_check.pyok (0.3s),tests/startup_gfx2hlsl_saveexec_same_reg_check.pyok (0.1s),tests/startup_gfx2hlsl_scalar_arity_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_brev_fold_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_m0_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_null_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_table_arity_check.pyok (0.4s),tests/startup_gfx2hlsl_sdwa_cndmask_check.pyok (0.2s),tests/startup_gfx2hlsl_sdwa_cvt_check.pyok (0.3s),tests/startup_gfx2hlsl_sgpr_spill_check.pyok (0.2s),tests/startup_gfx2hlsl_shift64_check.pyok (0.2s),tests/startup_gfx2hlsl_sload_const_offset_check.pyok (0.1s),tests/startup_gfx2hlsl_smem_offset_check.pyok (0.1s),tests/startup_gfx2hlsl_sop2_complement_check.pyok (7.3s),tests/startup_gfx2hlsl_sopk_accum_check.pyok (1.1s),tests/startup_gfx2hlsl_sopk_signext_check.pyok (0.1s),tests/startup_gfx2hlsl_spill_branches_check.pyok (1.0s),tests/startup_gfx2hlsl_swap_check.pyok (0.4s),tests/startup_gfx2hlsl_vopc_sdwa_check.pyok (4.7s),tests/startup_gfx2hlsl_waitcnt_depctr_check.pyok (0.1s),tests/startup_gfx2hlsl_watch_check.pyok (2.7s),tests/startup_image_2d_array_check.pyok (0.2s),tests/startup_image_3d_check.pyok (0.2s),tests/startup_image_gather_lz_check.pyok (0.6s),tests/startup_image_load_d16_check.pyok (1.0s),tests/startup_image_sample_a16_check.pyok (0.2s),tests/startup_image_sample_b_check.pyok (0.2s),tests/startup_image_sample_c_check.pyok (0.2s),tests/startup_image_sample_l_check.pyok (0.2s),tests/startup_image_sample_lod_check.pyok (0.6s),tests/startup_inline_sampler_check.pyok (0.2s),tests/startup_mesh57_depth_only_check.pyok (0.2s),tests/startup_mesh57_lane_spill_check.pyok (0.3s),tests/startup_mesh57_loop_check.pyok (0.2s),tests/startup_mesh57_loop_refusal_check.pyok (0.2s),tests/startup_mesh57_skeleton_check.pyok (1.2s),tests/startup_run_ps1_check.pyok (16.1s),tests/startup_run_sh_check.pyskipped (0.1s),tests/startup_sampler_heap_check.pyok (0.2s),tests/startup_shader_cache_rekey_check.pyok (2.9s),tests/startup_smem_address_check.pyok (0.2s),tests/startup_stream_fetch_check.pyok (0.2s),tests/startup_stream_interface_check.pyok (0.2s),tests/startup_translator_check.pyok (0.5s),tests/vk_offscreen.pyok (1.4s)sccache: 41/90 hits; wall584.3sSelection used:
minmax|signed_zero|med3|pixel_aot|fract|float_alu|shader_cache_key|indirect_draw|gfx2hlsl_root|compute_request, withoffscreen_checkrebuilt.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-26T03:43:26Z.
Independent AMD RDNA 4 result on
c1689a59— post-merge receipt on the merged head; no code change, measurements only.Environment
c1689a5984d94df6d61d8c438d1d65ef08b5e79e(merge ofmain817396ad, merged at2026-11-26T03:40:54Z), tracked tree clean,devpreset (Debug), rebuilt withcmake --build --preset dev --target offscreen_check; the build log ends with[11/12] Linking CXX executable offscreen_check.exe.Microsoft Windows [version 10.0.26200.9974],DisplayVersion 25H2,UBR 0x26f6; MSVC19.44.35230.0(read fromout/build/dev/CMakeFiles/4.4.4/CMakeCXXCompiler.cmake); DXC1.9.2602.17, FXC10.0.26100.9457.1002:7550, driver32.0.32029.2010. The 34 startup draws of the capture printbackend=hardware debug_layer=unavailable; the layer could not be enabled here, so nothing below is D3D12 API validation.offscreen_check.exeSHA-2565ED5E779E60C945825FE736283097114DA44D43003C294161819D13A0C01AE98.Commands
XBOX2WINDOWS_ADAPTERselected the card.Observed
The other two runs differ only in durations (
0.36 / 12.69 / 19.21and0.36 / 12.57 / 19.46), and no capture holds a***Skippedline. The no-argument arm prints20 signed-zero lowering checks reject both helper mutations.The fixture's own summaries, one per mode. Its convention is worth stating because it reads backwards: it exits 1 when differences are found, 0 when it finds none, and only
invertfails the run if nothing differs.252 words is 63 rows of four: 29 pixel rows at
ps_6_2, 17 startup rows atps_6_0, 17 atps_5_1.What the
plainrow showsThe
plainmutation replaces only the body ofminmax_zero32withmaximum ? max(a, b) : min(a, b); the NaN selection of the packed path and the min3/max3/med3 composition stay as this PR writes them. On this adapter it changes no result word:So on this card, with this driver and this compiler pair, the plain emission already produces the reference words, and the
drawarm cannot separate it from the helper. That the mutation is real is shown by the same script on WARP: 50/252 withplain, 0/252 withdraw.One correction to my own earlier comment: this does not fill the before cell of your table. The before column measures the translators before
150c625a;plainstrips one helper body out of the new translator, so 0/252 is the value I expect there, not one I observed. At this head the fixture'sbeforemode is an alias ofdraw(it mutates neither source and forces exit 0), so it cannot produce that column either.The neighbouring fixture from #1745, same host
The merge touches
tools/startup/gfx2hlsl.py, so I re-ran it: at this headstartup_gfx2hlsl_float_transcendental_hardwarepasses in both runs (100% tests passed out of 3), and with this FXC buildv_log_f32at input0x3e000000readsc0400000,v_sqrt_f32at0x41100000reads40400000. The GTX 1060c03fffffyou recorded above does not reproduce on this adapter.Limits
One adapter, one driver, one compiler pair, no layer validation. I first measured
7949526dand re-ran everything once the head moved toc1689a59(40 commits between them,tools/startup/gfx2hlsl.py531 insertions and 37 deletions); every number above was produced on the later head. Nothing here speaks for NVIDIA or Intel adapters, and nothing goes below the emitted HLSL: the arms compare result words, they do not show which instruction the driver emitted.AI-assisted.