Skip to content

shader: preserve signed zero in floating-point min and max - #2044

Merged
tedin7 merged 4 commits into
R0Y00:mainfrom
Jess-Doit:shader/signed-zero-min-max
Nov 26, 2026
Merged

tedin7 merged 4 commits into
R0Y00:mainfrom
Jess-Doit:shader/signed-zero-min-max

Conversation

@Jess-Doit

@Jess-Doit Jess-Doit commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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 (DXC ps_6_2) and startup (DXC ps_6_0 and FXC ps_5_1) paths. The table gives mismatches against the independent reference. Each offline draw also checks all 4,096 rendered pixels.

Adapter Before After
Windows 10 in-box WARP 50 / 252 0 / 252
GTX 1060 0 / 252 0 / 252

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 -1 and 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.

Form and input row WARP before WARP after and GTX 1060 before/after
f32 min (e32/e64, pixel also SDWA and DPP) 00000000 80000000 80000000 00000000 80000000 80000000 80000000 00000000
f32 max (same encodings) 00000000 80000000 80000000 00000000 00000000 00000000 80000000 00000000
min3, mixed (DXC) bf800000 bf800000 00000000 80000000 bf800000 bf800000 80000000 80000000
min3, mixed (FXC) bf800000 bf800000 80000000 00000000 bf800000 bf800000 80000000 80000000
max3, mixed (DXC) 00000000 80000000 40000000 40000000 00000000 00000000 40000000 40000000
max3, mixed (FXC) 80000000 00000000 40000000 40000000 00000000 00000000 40000000 40000000
med3, mixed 00000000 80000000 00000000 80000000 80000000 80000000 00000000 00000000
min3, all zeros (DXC / FXC) 00000000 80000000 00000000 80000000 / 80000000 00000000 80000000 00000000 80000000 80000000 80000000 80000000
max3, all zeros (DXC / FXC) 00000000 80000000 00000000 80000000 / 80000000 00000000 80000000 00000000 00000000 00000000 00000000 00000000
med3, all zeros 00000000 80000000 00000000 80000000 80000000 00000000 00000000 80000000
packed f16 min 80000000 00008000 80000000 00008000 80008000 80008000 80000000 00008000
packed f16 max 80000000 00008000 80000000 00008000 00000000 00000000 80000000 00008000

Single quiet NaN rows matched before and after on both adapters. For median with (-1, +2, qNaN), the pixel path returned bf800000 and the startup path returned 40000000, 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.

Preset Pass Fail Capability skip
Debug (dev) 65 0 0
Release (release) 65 0 0
Control WARP GTX 1060
Plain max/min in both generated shaders 50 / 252 mismatched 0 / 252 mismatched
Inverted zero sign rule in both generated shaders 84 / 252 mismatched 84 / 252 mismatched

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 00000000 in place of 80000000. 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_SDK to the Vulkan SDK 1.4.363.0 installation and make the Windows SDK shader compilers available. Use a Python environment with requirements-dev.txt installed.

. .\tools\dev.ps1
$env:XBOX2WINDOWS_ADAPTER = '1060'
$env:X2W_D3D12_DEBUG = '1'
$python = (Resolve-Path .\out\pe-env\Scripts\python.exe).Path
$tests = '^shader_signed_zero_minmax_|^startup_gfx2hlsl_|^pixel_aot_((core_vector|dpp_f16|dpp_extra|three_way|blend_scalar|pk_fmac|f16_arith|e64|sdwa_unary|vop3_ternary_int)_)?(warp|hardware)$|^docs_links$'
foreach ($preset in 'dev','release') {
    cmake --preset $preset "-DINTAKE_PYTHON=$python"
    cmake --build --preset $preset --target offscreen_check d3d12_xs_shim -j 2
    ctest --preset $preset --no-tests=error -j 1 -V -R $tests
}
& $python -B tests/shader_signed_zero_minmax_check.py
& $python -B tests/shader_signed_zero_minmax_check.py binary llvm-mc-15
$cache = 'out/build/dev/CMakeCache.txt'
$dxc = (Select-String '^DXC_EXECUTABLE:FILEPATH=' $cache).Line -replace '^DXC_EXECUTABLE:FILEPATH=', ''
$fxc = (Select-String '^STARTUP_FXC:FILEPATH=' $cache).Line -replace '^STARTUP_FXC:FILEPATH=', ''
foreach ($mode in 'plain','invert') {
    foreach ($adapter in 'warp','hardware') {
        & $python -B tests/shader_signed_zero_minmax_check.py $mode $dxc out/build/dev/offscreen_check.exe $adapter $fxc
    }
}

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 before in place of $mode against the base translators.

I reran the same $tests selection on the same machine, at e6560f18: 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 checks startup_image_sample_a16_check.py and startup_image_load_mip_check.py pass too.

AI-assisted (Codex, driven with Claude Code; Claude Code reviewed the change and reran the selection).

@ChazY11

ChazY11 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

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 that
git diff origin/main shows.

out/pe-env/Scripts/python.exe -B tests/shader_signed_zero_minmax_check.py
20 signed-zero lowering checks reject both helper mutations      exit 0
mutation in tools/shader_minmax.py result
the max/min zero rules swapped (&↔|) caught
the zero test becomes either == 0u (only both-+0 recognised) caught
the special case removed, straight max/min caught
max uses either like min caught
min uses a_bits & b_bits like max caught

The second one is the subtle one: (either & 0x7fffffffu) == 0u and either == 0u differ only when both operands are zero and at least one carries
the 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_zero32 and compared bit patterns (not ==, which cannot distinguish the two zeros) with a reference that reads the sign
from the bit pattern:

pairs checked: 288  mismatches: 0

max  +0,-0 -> 00000000     max  -0,+0 -> 00000000
min  +0,-0 -> 80000000     max  -0,-0 -> 80000000
min  -0,-0 -> 80000000     min  +0,+0 -> 00000000

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 of
what a naïve fmax/fmin would produce for the mixed pair on most hardware.

Exactly-one-zero must not take the special path, and it does not:

max  0.0, 1.0   -> 1.0        min  0.0,-1.0  -> -1.0
min  -0.0,1e-45 -> -0.0       max  -0.0,-1.0 -> -0.0

That last line is the interesting one: max(-0, -1) = -0, not 1e-45-style constant folding, and the helper reaches it through the normal max
branch 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 < 0 to detect negative zero. That is wrong in Python and in HLSL: -0.0 < 0.0 is false, because the
comparison is numeric and the two zeros are equal. It flagged four false mismatches before I switched to copysign/bit inspection. Anyone writing a
signed-zero test will hit this; the fixture needs bit comparison, not ==.

What I could not check

The claim that keeping the selection in asuint stops the compiler from merging the two float zeros. Without DXC I cannot show the generated assembly
either 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.inl revision bump (x2w-startup-shader-7) I take at face value — it is a cache key, and the fixture does not read it.

Notes

  • AI-assisted review.

@Jess-Doit

Copy link
Copy Markdown
Contributor Author

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 returns asfloat(zero) for the zero pair and otherwise max/min. I looked at the DXIL:

  • Integer helper: bitcast to i32, or/and, icmp eq (either & 0x7fffffff), 0, FMax/FMin (dx.op.binary.f32 35 and 36) on the other path, and the result bitcast back to i32.
  • Float-typed form: the same integer zero test, with the zero pair built by bitcast i32 ... to float and merged with the FMax result 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 -0 and +0 as 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.

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of head c56a2485b10194903482017bafb75a4c13a88481.

Verdict: no blocking findings. P1=0, P2=0.

What I checked

  • The helper 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 old min/max, so behavior elsewhere is unchanged.
  • Both translators use the same helper through one shared module (FLOAT_MINMAX): offline pixel (min, max, min3, max3, med3_32, packed minmax16_num) and startup (v_min_f32, v_max_f32, min3, max3, med3).
  • Packed f16 keeps the NaN-first selection and only defers to the zero rule for non-NaN pairs. This matches the PR text.
  • The startup cache revision moves to x2w-startup-shader-7 in src/startup_stubs/d3d12_draw.inl. It matches the revision the Python side hashes.
  • Clean-room: the title and body are neutral and the sources cited are the public ISA and DXIL docs. CMake registers the new Linux control plus warp and hardware draw tests, with SKIP_RETURN_CODE 77.

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 0
  • python3 tests/pixel_aot_check.py -> rc 0
  • python3 tests/docs_links_check.py -> Checked 18 Markdown files and 388 links.
  • python3 tests/bidi_controls_check.py -> no bidirectional controls
  • git diff --check origin/main...HEAD -> clean

Mutations I tried (reverted afterwards)

  1. In tools/startup/gfx2hlsl.py, I flipped the last polarity of v_max3_f32 from true to false. The new check failed with an AssertionError on max3, so it was killed.
  2. In tools/shader_minmax.py, I changed the max zero case from a_bits & b_bits to either. The check failed with an AssertionError on the helper text, so it was killed.

Nits (non-blocking)

  • Both mutations were killed by source-text assertions on Linux. The real GPU readback check (WARP and hardware draw tests) only runs on Windows. The Windows CI job is green. The PR's own table shows the WARP and GTX 1060 runs, but those were on Windows 10 22H2, not Win2025.
  • I did not run a Win2025 WARP pass myself. The change is shader lowering, so a maintainer may want that pass before moving the PR to Ready, if that is the gate.
  • med3 mixed-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.

@thepatrickworld

thepatrickworld commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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:

hardware startup ps_5_1 med3 row 2: bf800000,bf800000,40000000,00000000 (expected bf800000,bf800000,40000000,00000000)
hardware draw: 0/252 result words differ

Both compilers are covered (dxc ps_6_0/ps_6_2 and fxc ps_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_zero32 because they settle both operand orders:

V_MIN_F32:  else if (S0.f == +0.0 && S1.f == -0.0)     D.f = S1.f;
            else if (S0.f == -0.0 && S1.f == +0.0)     D.f = S0.f;
V_MAX_F32:  else if (S0.f == +0.0 && S1.f == -0.0)     D.f = S0.f;
            else if (S0.f == -0.0 && S1.f == +0.0)     D.f = S1.f;

so min returns -0 whenever one operand is -0, and max returns +0 whenever they differ — which is what either for min and a & b for max give, in both orders, and max(-0,-0) stays -0 through the else branch. V_MIN3_F32/V_MAX3_F32 are described as nested V_MIN_F32/V_MAX_F32 calls, 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.

@Jess-Doit

Jess-Doit commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

@thepatrickworld, thank you for the RX 9070 XT run (0/252 words differ, with both compilers) and for pulling out the exact clauses.

2919a123 puts them next to FLOAT_MINMAX in tools/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, so max(-0,-0) stays −0. It also notes that V_MIN3/V_MAX3/V_MED3 are defined through nested V_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.

df0dd5fa merges current main. It keeps this med3 next to main's new mul_hi_u32, and moves the startup shader cache revision to x2w-startup-shader-9 in both keys and the docs, because main is 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.

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review of head df0dd5fa89d169e2097b3905825c7a311e29ed28 (previous review was on c56a2485; the new commits are 2919a123 plus 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-tree against current origin/main (5 commits ahead) is clean.
  • CI on this head: Linux Python checks pass, gfx1013 fixtures pass, Windows build and test pass.
  • 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.
  • The binary llvm-mc-15 mode could not run here (llvm-mc-15 is not installed on this host). CI covers it.
  • Mutation 1: replaced the v_max3_f32 lowering in tools/startup/gfx2hlsl.py with plain max(max()). The test fails with an AssertionError. Killed.
  • Mutation 2: replaced maximum ? (a_bits & b_bits) : either with either in tools/shader_minmax.py. The test fails. Killed. Both mutations were reverted.
  • Win2025 run not repeated: the diff changes HLSL text and helper wiring only. The WARP and hardware draw tests are registered in CMake and the Windows CI job is green.

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/max3 are nested in both translators. med3 is rebuilt from the helper in both. NaN handling in med3_32 is kept. Packed binary16 goes through minmax16_num, which keeps the NaN select. All consistent.
  • FLOAT_MINMAX is emitted once per pixel source and once in the startup common(). Compute requests are still refused on main, so no compute preamble is missing the helper after the merge.
  • Startup cache revision is x2w-startup-shader-9 in both d3d12_draw.inl and gfx2hlsl.py and agrees with docs/startup-runtime.md:192.

Findings

  • P2 docs/experiments.md:6298 says the cache revision advances to x2w-startup-shader-7. The code and docs/startup-runtime.md:192 say -9. Update the doc line to -9.
  • nit tools/shader_minmax.py:9 has FLOAT_MINMAX =""". Add a space before =.
  • nit The Linux test pins emitted strings, so only the Windows WARP and hardware draw tests prove the value behavior. Keep those required before Ready.

P1=0 P2=1

AI-assisted; commands listed were executed locally.

@Jess-Doit

Copy link
Copy Markdown
Contributor Author

Thanks. Both fixed in b0bab44:

  • P2: docs/experiments.md:6298 now says x2w-startup-shader-9, matching the code and docs/startup-runtime.md:192.
  • Spacing nit: FLOAT_MINMAX = """.
  • Draw tests before Ready: agreed. The WARP and GTX 1060 draws were run for the original change, and the RX 9070 XT run above covers AMD. The emitted HLSL is unchanged since then, apart from the merged mul_hi_u32 that main added.

The signed-zero check (20 checks, both mutations rejected), docs links and git diff --check pass at b0bab44.

Status: ready to merge from our side once CI is green.

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review of head b0bab443dcefc694d4040f186e1626e893b333c5 (previous review was on df0dd5fa; the one new commit is b0bab443, docs and spacing only).

Summary: no blocking issues. The earlier P2 and the earlier nit are both resolved.

Previous findings

  • P2 (docs/experiments.md said x2w-startup-shader-7): resolved. Line 6298 now says x2w-startup-shader-9. It agrees with src/startup_stubs/d3d12_draw.inl:210, tools/startup/gfx2hlsl.py:2711 and docs/startup-runtime.md:192.
  • nit (FLOAT_MINMAX =""" spacing in tools/shader_minmax.py): resolved.
  • nit (Linux test pins emitted strings): still true and still fine. Keep the WARP and hardware draw tests required before Ready.

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.
  • Mutation: replaced maximum ? (a_bits & b_bits) : either with either in tools/shader_minmax.py. The check fails with an AssertionError. Killed. Reverted with git checkout -- ..
  • CI on this head: Linux Python checks pass, gfx1013 fixtures pass, Windows build and test pass.
  • Win2025 run not repeated: since the last reviewed head only a doc line and one space changed.

Findings

  • P1: none.
  • P2: none.

AI-assisted; commands listed were executed locally.

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at head 4beb58eb04dfd2b1d226cc0cceab6ea711ba4da2 (a merge of main into the branch; no change to the min/max logic since the previously reviewed head b0bab443).

Findings

  • P1: none.
  • P2: none.
  • Nit: reverting x2w-startup-shader-9 to -8 in tools/startup/gfx2hlsl.py alone is not caught by shader_signed_zero_minmax_check.py or startup_gfx2hlsl_mad_check.py. The Python key and the src/startup_stubs/d3d12_draw.inl:222 constant could drift apart without a failing test. Consider a small check that both strings match.
  • Nit: the Linux-only mutation of the helper is rejected by the exact-source pin, not by behavior. Behavior is only exercised by the warp/hardware draw 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 because either & 0x7fffffff != 0, so NaN behavior is unchanged.
  • pixel_aot.py (min, max, min3, max3, med3_32, packed f16 minmax16_num) and gfx2hlsl.py (v_min/max_f32, min3/max3, med3) all route through the helper. FLOAT_MINMAX is emitted once per shader in both translators.
  • The cache revision is bumped in both places, gfx2hlsl.py and d3d12_draw.inl.
  • CMake and windows.yml register the new test, including the warp and hardware draw variants.
  • The title is neutral. The PR is mergeable. The Linux CI job passes. The Windows jobs were still pending when I checked.

Commands run locally (all passed)

  • python3 tests/shader_signed_zero_minmax_check.py -> 20 signed-zero lowering checks reject both helper mutations
  • python3 tests/pixel_aot_check.py -> rc 0
  • python3 tests/startup_gfx2hlsl_mad_check.py -> pass
  • python3 tests/docs_links_check.py -> 412 links OK
  • python3 tests/bidi_controls_check.py -> OK
  • git diff --check origin/main...HEAD -> clean
  • Mutation 1: changed max's AND to OR in shader_minmax.py. The test failed with an AssertionError, so it is killed. Reverted.
  • Mutation 2: reverted the cache revision to -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.

@tedin7

tedin7 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

@Jess-Doit could you rebase this branch onto current main and force-push?

GitHub reports head 4beb58eb as conflicting with main, so it cannot be merged as is.

Files that conflict with current main (4aaea119):

  • docs/startup-runtime.md
  • src/startup_stubs/d3d12_draw.inl
  • tools/startup/gfx2hlsl.py

Commands run locally:

git fetch origin main pull/2044/head
git merge-tree --write-tree --name-only origin/main FETCH_HEAD
gh pr view 2044 --json mergeable   # CONFLICTING

Once it is rebased and CI is green it will be re-checked right away.

AI-assisted; commands listed were executed locally.

@Jess-Doit
Jess-Doit force-pushed the shader/signed-zero-min-max branch from 4beb58e to 69c6db7 Compare November 25, 2026 17:08
@Jess-Doit

Jess-Doit commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

@tedin7 thanks. Rebased onto current main (7092683a) as one commit and force-pushed: head is now 69c6db79.

What changed in the rebase:

  • main had 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.py requires the compute revision to follow the graphics one.
    • The two test mirrors of the revision string are updated too.
    • The pinned key in startup_compute_request_offline_check.py is recomputed with the test's own framing function.
  • pixel_aot.py keeps main's TITLE_MEMORY_X2 selection and prepends FLOAT_MINMAX as before.

Tests on Windows 10 build 19045, dev preset, 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_warp failed on the revision rule above. It passes after the fix, along with the other revision-dependent tests.
    • pixel_aot_title_loads_warp fails here, and fails the same way on main on this host's WARP.
  • Pure-Python: shader_signed_zero_minmax_check, startup_gfx2hlsl_buffer_store_check, startup_compute_request_offline_check, docs_links_check and bidi_controls_check pass.

Ready to merge from our side.

legacy-code-archaeologist added a commit to legacy-code-archaeologist/Xbox2Windows that referenced this pull request Nov 25, 2026
# Conflicts:
#	AGENTS.md
#	docs/startup-runtime.md
#	src/startup_stubs/d3d12_draw.inl
#	tools/pixel_aot.py
#	tools/startup/gfx2hlsl.py
legacy-code-archaeologist added a commit to legacy-code-archaeologist/Xbox2Windows that referenced this pull request Nov 25, 2026
# Conflicts:
#	AGENTS.md
#	docs/experiments.md
#	docs/startup-runtime.md
#	tests/startup_gfx2hlsl_buffer_store_check.py
#	tools/startup/gfx2hlsl.py
@Jess-Doit
Jess-Doit force-pushed the shader/signed-zero-min-max branch from 69c6db7 to 706767a Compare November 25, 2026 22:01
@Jess-Doit

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (0104f763) as one commit and force-pushed: head is now 706767ac.

Revision: #2010 moved the startup shader cache revision to 16, so this change now advances it to 17.

Tests on Windows 10 19045, GTX 1060 + WARP, ctest -R "minmax|signed_zero|compute_request|indirect_draw|gfx2hlsl|pixel_aot|fract|resource_retire|mesh":

  • 495 of 499 ran without failing. The mesh cases were capability skips on this host.
  • The 4 failures also fail on a clean build of main 0104f763 on the same host: pixel_aot_title_loads_warp, startup_gfx2hlsl_f32_sdwa_warp (WARP denormal behaviour) and startup_resource_retire_title_hardware_debug0/debug1.
  • shader_signed_zero_minmax_check.py (20 mutation checks) and startup_compute_request_offline_check.py pass.

Ready to merge from our side.

@thepatrickworld

Copy link
Copy Markdown
Contributor

Heads-up, because the numbers moved under this branch.

#2095 merged at 21:48 as bd53c9b6 and took x2w-startup-shader-17 / 17cs, so main is at 17 and this branch's 17 / 17cs now collide with it: it needs 18 / 18cs. Worth stating explicitly — after a rebase the two revisions look identical in git 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 made v_med3_f32 lower through med3_32(...) (the minimum of the three when a source is NaN), and this branch replaces that same call site with minmax_zero32(...). A rebase has to keep both behaviours, not just rename a key; the med3 helper body sits in the same block.

Two smaller ones. tests/startup_gfx2hlsl_fract_check.py here still compares 'x2w-startup-shader-15' against '16', where main now has ('16', '17'). And the slot 57 mesh key is untouched by our merge — main still carries x2w-startup-mesh-57-2, so the move to 57-3 stands.

AI-assisted.

@Jess-Doit
Jess-Doit force-pushed the shader/signed-zero-min-max branch from 706767a to 25e01dc Compare November 25, 2026 23:33
@Jess-Doit

Copy link
Copy Markdown
Contributor Author

Rebased onto main (cece3a36) and force-pushed: head is now 25e01dc8. GitHub reports it mergeable with current main (780c0bc4).

What changed since 706767ac:

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":

  • 411 of 421 ran without failing. The 8 skips are capability skips on this host.
  • shader_signed_zero_minmax_warp/_hardware, startup_gfx2hlsl_f32_med3_warp/_hardware, compute_store_aot_alu_med3_* and startup_gfx2hlsl_root all pass.
  • 9 failures also fail on a clean build of main 5ba062eb on this host. They are the seven startup_resource_retire_{reasons,title,views}*_hardware arms (the four views arms segfault), startup_gfx2hlsl_f32_sdwa_warp and pixel_aot_title_loads_warp.
  • pixel_aot_cvt_f64_f32_hardware timed out at its 60 s limit under -j 2, and passed in 39 s when rerun alone.

Ready to merge from our side.

Both translators resolve a pair of zeros from the sign bits (maximum ANDs
the signs, minimum ORs them), following the RDNA 2 V_MIN/V_MAX clauses.
The startup shader cache revisions advance from 14 to 15 and 15cs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jess-Doit

Copy link
Copy Markdown
Contributor Author

Fixed the failed Build and test on Windows job: head is now a9fc952f.

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, and 0xf9e74efdcb8283d2 with the input layout. The comment now names revision 18. The runtime literal in d3d12_draw.inl is the same revision, and startup_indirect_draw_indexed checks 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.
  • I ran every tests/*.py that uses pipeline_key, compute_key or a revision literal on this branch and on main. 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.

@Jess-Doit
Jess-Doit force-pushed the shader/signed-zero-min-max branch from 25e01dc to a9fc952 Compare November 26, 2026 01:04
@thepatrickworld

Copy link
Copy Markdown
Contributor

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, dev preset, Windows 11 25H2 build 26200.9974, MSVC tools 14.44.35207, AMD Radeon RX 9070 XT (1002:7550, driver 32.0.32029.2010).

cmake --preset dev -DINTAKE_PYTHON=…\out\pe-env\Scripts\python.exe
cmake --build --preset dev
ctest --preset dev --no-tests=error -R "^shader_signed_zero_minmax"
1/3 Test #875: shader_signed_zero_minmax_controls ...   Passed    0.45 sec
2/3 Test #876: shader_signed_zero_minmax_warp .......   Passed   13.55 sec
3/3 Test #877: shader_signed_zero_minmax_hardware ...   Passed   20.29 sec
100% tests passed out of 3

All three ran and passed; the capture holds no Skipped line and no ***Failed line. 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:

hardware draw: 0/252 result words differ

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 at 150c625ae9b0; 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:

ctest --preset dev --no-tests=error -R "^pixel_aot_compare_.*_(hardware|warp)$"
ctest --preset dev --no-tests=error -R "^startup_gfx2hlsl_(f32_med3|fract|root|mul24_align)$"

and what they reported:

100% tests passed out of 4
2/2 Test #1013: startup_gfx2hlsl_root ............   Passed    1.10 sec
100% tests passed out of 2

Two of the four names in that second filter exist in the suite; root is the line the capture kept.

The hardware run reports debug_layer=unavailable, so the adapter result carries no validation-layer output.

AI-assisted.

@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Merged current main into the branch (merge commit 04f26e56, 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 on main pins revision 17, so nothing else needed re-pinning.

Commands executed locally

  • Linux: ran every tests/*.py that 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 clean main.
  • Windows Server 2025 (WARP), dev and release, on the merged tree: 230 of 234 selected tests passed on the first run. shader_signed_zero_minmax_warp, startup_gfx2hlsl_f32_med3_warp, startup_gfx2hlsl_root, startup_shader_cache_key and startup_indirect_draw_indexed_warp all passed.
  • The 4 failures were pixel_aot_compare_lod_{level,bias}_{warp,hardware}: offscreen_check.exe was stale and did not know --check-pixel-compare-level. After rebuilding offscreen_check, all 4 pass in dev and release.

AI-assisted; commands listed were executed locally.

…n-max

# Conflicts:
#	tools/startup/gfx2hlsl.py
@Jess-Doit

Copy link
Copy Markdown
Contributor Author

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.

main moved 26 commits past 04f26e56, so I merged current main (d41a9a80) on top of your merge rather than rebasing. Head is now 7949526d, and GitHub reports it mergeable with main 47ffb877.

The conflict and two follow-ups:

Checks:

  • Every tests/*.py that names min/max/med3, a cache key or a revision gives the same result on this branch and on main. The only exception is shader_signed_zero_minmax_check.py, which this PR adds.
  • Windows 10 19045, GTX 1060 6GB (driver 32.0.15.6094) + WARP:
    • ctest --preset pr --no-tests=error: 38 of 38 pass.
    • The broad selection (min/max, med3, float_alu, lane_alu, gfx2hlsl, pixel_aot, compute_request, indirect_draw, resource_retire, shader_cache): 480 of 492 ran without failing, with 12 capability skips.
    • startup_gfx2hlsl_float_alu_{controls,warp,hardware} pass, and so do shader_signed_zero_minmax_* and startup_gfx2hlsl_f32_med3_*.
  • 9 failures are the same host-specific set that fails on a clean main here: the seven startup_resource_retire_{reasons,title,views}*_hardware arms, startup_gfx2hlsl_f32_sdwa_warp and pixel_aot_title_loads_warp.
  • 1 is new on this host, startup_gfx2hlsl_float_transcendental_hardware from startup: draw the gfx2hlsl reciprocal, root, exp2 and log2 operations #1745. On the GTX 1060 the FXC v_log_f32 draw reads c03fffff for log2(0.125), where c0400000 is expected: one ulp off -3.0. That test uses no min, max or med3.

Ready to merge from our side.

@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Win2025 WARP receipt for head c1689a5 after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit c1689a5984d94df6d61d8c438d1d65ef08b5e79e:

  • Debug (--preset dev):
    • Build (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 (configure 2.47s)
    • Test (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_warp 15.69s, pixel_aot_core_vector_warp 18.18s, pixel_aot_warp 19.17s, pixel_aot_bits_warp 24.90s, pixel_aot_buffer_color_warp 10.39s, pixel_aot_predicate_rounding_warp 10.15s, pixel_aot_comparisons_warp 7.53s, pixel_aot_cmpx_regions_warp 6.82s, pixel_aot_compare_warp 22.18s, pixel_aot_blend_scalar_warp 11.54s, pixel_aot_bits_hardware 9.12s, pixel_aot_compare_hardware 22.07s, pixel_aot_cvt_f64_f32_warp 11.21s, pixel_aot_hardware 9.26s, pixel_aot_cvt_int_f64_warp 8.97s, pixel_aot_e64_warp 5.84s, pixel_aot_blend_scalar_hardware 7.39s, pixel_aot_comparisons_hardware 7.41s, startup_gfx2hlsl_float_alu_hardware 14.48s, pixel_aot_buffer_color_hardware 6.52s, startup_gfx2hlsl_float_alu_warp 14.79s, pixel_aot_f16_arith_warp 8.60s, pixel_aot_three_way_hardware 7.38s, pixel_aot_core_vector_hardware 8.71s, pixel_aot_cvt_f64_f32_hardware 11.41s, pixel_aot_cmpx_regions_hardware 11.23s, pixel_aot_cmpx_e64_warp 5.92s, pixel_aot_cvt_flr_rpi_warp 5.09s, pixel_aot_gather_warp 4.14s, pixel_aot_compare_gather_warp 3.91s, shader_signed_zero_minmax_warp 7.25s, pixel_aot_exec_regions_warp 5.06s, shader_signed_zero_minmax_hardware 7.47s, pixel_aot_e64_hardware 5.45s, compute_store_aot_alu_minmax3_hardware 2.24s, pixel_aot_sample_coarse_gradient_hardware 3.28s, pixel_aot_cmp_f64_warp 4.68s, pixel_aot_cmpx_e64_hardware 5.51s, pixel_aot_sample_gradient_hardware 3.09s, pixel_aot_f16_arith_hardware 4.67s, pixel_aot_cvt_flr_rpi_hardware 4.88s, pixel_aot_f16_round_warp 3.42s, pixel_aot_cvt_f64_int_warp 3.92s, pixel_aot_compare_sample_warp 3.86s, compute_store_aot_alu_med3_hardware 1.88s, pixel_aot_u32_from_f32_warp 1.65s, pixel_aot_cmp64_warp 3.43s, pixel_aot_compare_gather_hardware 4.07s, pixel_aot_sample_lod_warp 2.05s, pixel_aot_dpp_f16_warp 5.17s, pixel_aot_shift64_warp 4.71s, compute_store_aot_mimg_atomic_minmax_hardware 1.98s, pixel_aot_predicate_rounding_hardware 4.98s, pixel_aot_f16_fmac_ldexp_warp 3.10s, pixel_aot_sample_coarse_gradient_warp 3.42s, compute_store_aot_alu_minmax3_warp 2.31s, pixel_aot_exec_regions_hardware 5.13s, compute_store_aot_alu_med3_warp 1.87s, pixel_aot_cvt_int_f64_hardware 5.45s, compute_store_aot_mimg_atomic_minmax_warp 2.18s, pixel_aot_u32_from_f32_hardware 1.79s, pixel_aot_sample_gradient_warp 3.15s, pixel_aot_gather_hardware 4.27s, pixel_aot_sample_offset_warp 2.71s, pixel_aot_dpp_f16_hardware 5.48s, pixel_aot_cmp_f64_hardware 5.00s, pixel_aot_cmp64_hardware 4.14s, pixel_aot_dpp_cvt_hardware 2.22s, pixel_aot_dmask_warp 2.13s, pixel_aot_dpp_extra_warp 3.07s, pixel_aot_rndne_warp 1.96s, pixel_aot_get_lod_warp 2.05s, pixel_aot_compare_sample_hardware 4.02s, pixel_aot_shift64_hardware 4.84s, pixel_aot_f16_round_hardware 3.50s, pixel_aot_cvt_f64_int_hardware 3.80s, pixel_aot_attribute_warp 1.48s, pixel_aot_int16_ternary_warp 3.44s, pixel_aot_s_call_hardware 1.51s, startup_compute_request_warp 3.76s, pixel_aot_dpp_extra_hardware 2.61s, pixel_aot_f16_cvt_int16_warp 2.50s, pixel_aot_f16_fmac_ldexp_hardware 2.66s, pixel_aot_attribute_hardware 1.17s, pixel_aot_f16_exact_extra_warp 3.07s, pixel_aot_sample_offset_hardware 2.49s, pixel_aot_int16_ternary_hardware 2.96s, pixel_aot_mac_legacy_hardware 1.48s, pixel_aot_f16_exact_extra_hardware 3.07s, pixel_aot_region_body_warp 2.37s, pixel_aot_get_lod_hardware 2.28s, pixel_aot_sdwa_movrel_hardware 1.71s, pixel_aot_scc_skip_hardware 2.01s, pixel_aot_sdwa_f16_warp 2.85s, pixel_aot_sdwa_f16_hardware 2.74s, pixel_aot_dpp_cvt_warp 2.05s, pixel_aot_sad_hardware 1.41s, pixel_aot_f16_cvt_int16_hardware 2.56s, pixel_aot_scc_skip_warp 1.94s, pixel_aot_region_scalar_load_hardware 1.66s, pixel_aot_cvt_float_int_e64_warp 2.10s, pixel_aot_cvt_f32_f64_warp 2.00s, pixel_aot_sample_lod_hardware 2.21s, pixel_aot_region_body_hardware 2.42s, pixel_aot_rndne_hardware 2.06s, pixel_aot_dmask_hardware 2.06s, pixel_aot_int16_vop3_warp 1.88s, pixel_aot_sdwa_cvt_hardware 2.58s, pixel_aot_sdwa_cvt_warp 2.59s, pixel_aot_title_loads_hardware 2.65s, pixel_aot_pk_fmac_warp 1.76s, pixel_aot_region_scalar_load_warp 1.83s, pixel_aot_sample_clamp_compile 2.57s, pixel_aot_sdwa_int_extra_warp 2.44s, pixel_aot_carry_in_warp 1.52s, pixel_aot_f16_to_int16_warp 1.83s, pixel_aot_plain_movrel_warp 1.83s, pixel_aot_bitset64_warp 2.04s, pixel_aot_div_fmas_warp 1.62s, pixel_aot_sdwa_int_extra_hardware 2.41s, pixel_aot_vop3_ternary_int_warp 2.17s, pixel_aot_region_waits_hardware 1.43s, pixel_aot_compare_lod_bias_warp 2.62s, pixel_aot_plain_bitscan_warp 1.81s, pixel_aot_cvt_float_int_e64_hardware 2.11s, pixel_aot_swap_warp 1.42s, pixel_aot_align_warp 2.51s, pixel_aot_compare_lod_bias_hardware 2.61s, pixel_aot_vop3_ternary_int_hardware 1.96s, pixel_aot_mac_legacy_warp 1.52s, pixel_aot_sdwa_unary_warp 1.41s, pixel_aot_cvt_f32_f64_hardware 2.28s, pixel_aot_compare_lod_level_hardware 2.62s, pixel_aot_s_call_warp 1.34s, pixel_aot_align_hardware 2.13s, pixel_aot_compare_lod_level_warp 2.51s, pixel_aot_int16_vop3_hardware 2.09s, pixel_aot_bitset64_hardware 2.19s, pixel_aot_uncompressed_export_warp 1.47s, pixel_aot_flat_scratch_warp 1.81s, pixel_aot_dpp_movrel_hardware 1.61s, pixel_aot_first_bit_warp 1.92s, pixel_aot_f16_to_int16_hardware 1.96s, pixel_aot_plain_movrel_hardware 1.97s, pixel_aot_pk_fmac_hardware 1.75s, pixel_aot_sdwa_movrel_warp 1.74s, mesh_entry_cvt_minmax_draw_warp 1.79s, pixel_aot_smovrel_warp 1.45s, pixel_aot_dpp_movrel_warp 1.49s, pixel_aot_mad64_warp 1.61s, pixel_aot_bfm_warp 1.34s, pixel_aot_plain_bitscan_hardware 1.91s, pixel_aot_sdwa_unary_hardware 1.47s, pixel_aot_e64_integer_warp 1.40s, pixel_aot_title_loads_warp 2.72s, pixel_aot_sdwa_integer_warp 1.54s, pixel_aot_region_waits_warp 1.34s, pixel_aot_brev_warp 1.31s, pixel_aot_e64_spellings_warp 1.61s, pixel_aot_swaprel_warp 1.26s, pixel_aot_sdwa_cmp_warp 1.35s, pixel_aot_uncompressed_integer_export_warp 1.53s, pixel_aot_first_bit_hardware 1.82s, pixel_aot_region_scalar_alu_warp 1.39s, pixel_aot_flat_scratch_hardware 1.86s, pixel_aot_sad_warp 1.45s, pixel_aot_div_fmas_hardware 2.03s, pixel_aot_carry_out_warp 1.67s, pixel_aot_integer_nc_warp 1.46s, pixel_aot_frexp_exp_warp 1.61s, pixel_aot_e64_spellings_hardware 1.37s, pixel_aot_sdwa_integer_hardware 1.48s, pixel_aot_smovrel_hardware 1.23s, pixel_aot_pack_int16_warp 1.14s, pixel_aot_e64_approx_warp 1.12s, mesh_entry_cvt_minmax_draw_hardware 1.60s, pixel_aot_uncompressed_integer_export_hardware 1.26s, pixel_aot_ds_swizzle_warp 1.28s, pixel_aot_sdwa_cmp_hardware 1.69s, pixel_aot_carry_in_hardware 1.55s, pixel_aot_brev_hardware 1.46s, pixel_aot_sdwa_int_compare_warp 1.67s, pixel_aot_compressed_export_warp 1.01s, pixel_aot_mad64_hardware 1.54s, pixel_aot_sdwa_int_compare_hardware 1.54s, pixel_aot_swap_hardware 1.41s, pixel_aot_pack_b32_warp 1.19s, pixel_aot_smem_pointers_warp 1.21s, pixel_aot_swaprel_hardware 1.33s, pixel_aot_e64_integer_hardware 1.36s, pixel_aot_carry_out_hardware 1.40s, pixel_aot_uncompressed_export_hardware 1.37s, pixel_aot_frexp_exp_hardware 1.49s, pixel_aot_region_scalar_alu_hardware 1.26s, pixel_aot_sopk_hwreg_warp 1.10s, pixel_aot_vop1_nops_warp 1.04s, pixel_aot_integer_nc_hardware 1.21s, pixel_aot_bfm_hardware 1.22s, pixel_aot_compressed_export_hardware 1.08s, pixel_aot_ds_swizzle_hardware 1.16s, pixel_aot_e64_approx_hardware 0.92s, pixel_aot_pack_int16_hardware 1.28s, pixel_aot_smem_pointers_hardware 1.24s, pixel_aot_sopp_round_mode_warp 1.15s, pixel_aot_vop1_nops_hardware 0.87s, pixel_aot_pack_b32_hardware 1.08s, pixel_aot_sopk_hwreg_hardware 1.31s, pixel_aot_sample_clamp_controls 1.35s, startup_gfx2hlsl_root 1.32s, pixel_aot_sopp_round_mode_hardware 1.35s, startup_gfx2hlsl_f32_med3_warp 1.07s, pixel_aot_attribute_sampled_warp 1.10s, startup_shader_cache_key 0.97s, pixel_aot_attribute_sampled_hardware 1.00s, startup_gfx2hlsl_f32_med3_hardware 0.87s, startup_gfx2hlsl_fract_draw_hardware 0.81s, startup_gfx2hlsl_fract_draw_warp 0.79s, cpu_aot_avx_int_minmax_mul 0.44s, cpu_aot_avx_int_ymm_minmax 0.72s, startup_compute_request_offline 0.82s, startup_compute_lds_dual_atomics_a-swap-minmax_hardware 0.44s, startup_compute_lds_dual_atomics_a-swap-minmax_warp 0.47s, shader_signed_zero_minmax_controls 0.39s, startup_gfx2hlsl_f32_med3_controls 0.31s, startup_gfx2hlsl_float_alu_controls 0.40s, startup_indirect_draw_indexed_warp 0.16s, startup_gfx2hlsl_int_med3_controls 0.22s, startup_compute_request_disabled_control 0.29s, startup_indirect_draw_indexed_hardware 0.05s, startup_gfx2hlsl_fract 0.31s, startup_indirect_draw_warp 0.13s, startup_indirect_draw_hardware 0.05s, spirv_minlod_fractional_hardware 0.09s, spirv_minlod_fractional_warp 0.10s, startup_gfx2hlsl_fract_draw_controls 0.30s, pixel_aot_sample_clamp_hardware 4.01s, pixel_aot_sample_clamp_warp 4.07s); skipped (capability, not a pass): startup_indirect_draw_indexed_hardware, startup_indirect_draw_hardware, spirv_minlod_fractional_hardware, spirv_minlod_fractional_warp
  • Release /O2 (--preset release):
    • Build (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 (configure 4.44s)
    • Test (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_warp 14.20s, pixel_aot_core_vector_warp 20.17s, pixel_aot_warp 20.58s, pixel_aot_bits_warp 20.65s, pixel_aot_buffer_color_warp 7.12s, pixel_aot_predicate_rounding_warp 5.00s, pixel_aot_comparisons_warp 7.30s, pixel_aot_cmpx_e64_warp 5.22s, pixel_aot_cmpx_regions_warp 6.68s, pixel_aot_compare_warp 19.28s, pixel_aot_compare_hardware 19.36s, pixel_aot_cvt_f64_f32_warp 10.71s, pixel_aot_hardware 9.08s, pixel_aot_blend_scalar_warp 7.18s, pixel_aot_comparisons_hardware 7.27s, startup_gfx2hlsl_float_alu_warp 14.49s, pixel_aot_bits_hardware 9.29s, pixel_aot_cmpx_regions_hardware 10.73s, startup_gfx2hlsl_float_alu_hardware 14.47s, pixel_aot_compare_gather_warp 4.35s, pixel_aot_exec_regions_warp 5.20s, pixel_aot_core_vector_hardware 4.84s, pixel_aot_cvt_f64_f32_hardware 7.10s, shader_signed_zero_minmax_warp 12.61s, pixel_aot_buffer_color_hardware 7.72s, pixel_aot_blend_scalar_hardware 16.47s, shader_signed_zero_minmax_hardware 16.81s, pixel_aot_three_way_hardware 7.64s, pixel_aot_dpp_f16_hardware 9.23s, pixel_aot_region_body_warp 2.23s, pixel_aot_cvt_flr_rpi_warp 4.73s, pixel_aot_f16_arith_warp 4.48s, pixel_aot_e64_warp 5.13s, compute_store_aot_mimg_atomic_minmax_hardware 2.01s, compute_store_aot_alu_minmax3_hardware 2.26s, compute_store_aot_alu_med3_hardware 1.76s, pixel_aot_sample_lod_warp 2.27s, pixel_aot_cvt_int_f64_hardware 4.74s, pixel_aot_dpp_extra_warp 2.71s, pixel_aot_sample_coarse_gradient_warp 3.15s, pixel_aot_f16_round_warp 3.25s, pixel_aot_compare_sample_warp 3.77s, pixel_aot_e64_hardware 4.97s, pixel_aot_cmpx_e64_hardware 4.96s, compute_store_aot_alu_minmax3_warp 2.26s, pixel_aot_dpp_extra_hardware 2.68s, pixel_aot_exec_regions_hardware 4.78s, pixel_aot_cvt_int_f64_warp 4.67s, pixel_aot_sdwa_cvt_hardware 2.37s, pixel_aot_region_waits_warp 1.34s, compute_store_aot_mimg_atomic_minmax_warp 1.94s, pixel_aot_f16_arith_hardware 4.23s, pixel_aot_sample_coarse_gradient_hardware 3.20s, pixel_aot_dpp_f16_warp 4.82s, pixel_aot_dpp_cvt_warp 2.10s, compute_store_aot_alu_med3_warp 1.78s, pixel_aot_cmp_f64_warp 4.23s, pixel_aot_predicate_rounding_hardware 4.58s, pixel_aot_sample_gradient_warp 3.22s, pixel_aot_cvt_flr_rpi_hardware 4.55s, pixel_aot_gather_warp 4.15s, pixel_aot_get_lod_warp 2.23s, pixel_aot_gather_hardware 4.36s, pixel_aot_sample_offset_warp 2.55s, pixel_aot_compare_gather_hardware 4.17s, pixel_aot_f16_round_hardware 3.20s, pixel_aot_compare_sample_hardware 3.75s, pixel_aot_shift64_warp 3.88s, pixel_aot_cmp_f64_hardware 3.95s, pixel_aot_f16_fmac_ldexp_warp 2.72s, pixel_aot_cvt_f64_int_hardware 3.39s, pixel_aot_cvt_f64_int_warp 3.31s, pixel_aot_shift64_hardware 3.93s, pixel_aot_sdwa_f16_warp 2.85s, pixel_aot_attribute_warp 1.33s, pixel_aot_cmp64_warp 2.95s, pixel_aot_sample_gradient_hardware 3.29s, pixel_aot_dmask_warp 2.01s, pixel_aot_f16_exact_extra_warp 3.06s, pixel_aot_u32_from_f32_warp 1.51s, pixel_aot_sdwa_f16_hardware 2.73s, pixel_aot_int16_ternary_warp 2.54s, pixel_aot_region_scalar_load_hardware 1.71s, pixel_aot_f16_cvt_int16_warp 2.47s, pixel_aot_f16_fmac_ldexp_hardware 2.87s, startup_compute_request_warp 2.81s, pixel_aot_plain_movrel_warp 1.64s, pixel_aot_vop3_ternary_int_warp 1.82s, pixel_aot_sdwa_int_extra_warp 2.19s, pixel_aot_uncompressed_integer_export_warp 1.23s, pixel_aot_sdwa_int_extra_hardware 2.09s, pixel_aot_cmp64_hardware 2.73s, pixel_aot_cvt_float_int_e64_warp 1.74s, pixel_aot_sdwa_cvt_warp 2.39s, pixel_aot_scc_skip_warp 1.82s, pixel_aot_scc_skip_hardware 1.79s, pixel_aot_dpp_movrel_warp 1.41s, pixel_aot_int16_ternary_hardware 2.57s, pixel_aot_pk_fmac_warp 1.65s, pixel_aot_compressed_export_warp 1.13s, pixel_aot_dpp_cvt_hardware 2.26s, pixel_aot_rndne_warp 1.97s, pixel_aot_compare_lod_level_warp 2.57s, pixel_aot_compare_lod_bias_hardware 2.47s, pixel_aot_f16_exact_extra_hardware 3.01s, pixel_aot_cvt_f32_f64_hardware 2.04s, pixel_aot_sample_clamp_compile 2.62s, pixel_aot_cvt_f32_f64_warp 2.01s, pixel_aot_sample_offset_hardware 2.53s, pixel_aot_region_body_hardware 2.28s, pixel_aot_f16_cvt_int16_hardware 2.48s, pixel_aot_region_scalar_load_warp 1.78s, pixel_aot_f16_to_int16_warp 1.79s, pixel_aot_int16_vop3_warp 1.85s, pixel_aot_title_loads_hardware 2.42s, pixel_aot_swaprel_warp 1.24s, pixel_aot_get_lod_hardware 2.20s, pixel_aot_bitset64_warp 1.80s, pixel_aot_vop3_ternary_int_hardware 1.90s, pixel_aot_sdwa_integer_warp 1.48s, pixel_aot_sdwa_movrel_hardware 1.39s, pixel_aot_uncompressed_export_warp 1.25s, pixel_aot_div_fmas_warp 1.70s, pixel_aot_sample_lod_hardware 2.27s, pixel_aot_compare_lod_bias_warp 2.26s, pixel_aot_rndne_hardware 2.03s, pixel_aot_align_warp 1.77s, pixel_aot_bitset64_hardware 1.52s, pixel_aot_compare_lod_level_hardware 2.42s, pixel_aot_cvt_float_int_e64_hardware 1.99s, pixel_aot_plain_bitscan_warp 1.63s, pixel_aot_int16_vop3_hardware 1.87s, pixel_aot_flat_scratch_warp 1.64s, pixel_aot_title_loads_warp 2.48s, pixel_aot_u32_from_f32_hardware 1.50s, pixel_aot_first_bit_warp 1.66s, pixel_aot_sdwa_movrel_warp 1.55s, pixel_aot_ds_swizzle_warp 0.94s, pixel_aot_sad_warp 1.37s, pixel_aot_align_hardware 1.84s, pixel_aot_mad64_warp 1.44s, pixel_aot_carry_in_warp 1.42s, pixel_aot_mad64_hardware 1.39s, pixel_aot_brev_warp 1.33s, pixel_aot_region_scalar_alu_warp 1.35s, pixel_aot_pk_fmac_hardware 1.70s, pixel_aot_smovrel_warp 1.30s, pixel_aot_plain_movrel_hardware 1.80s, pixel_aot_dmask_hardware 2.04s, pixel_aot_dpp_movrel_hardware 1.53s, pixel_aot_smovrel_hardware 1.55s, pixel_aot_swap_warp 1.45s, pixel_aot_frexp_exp_warp 1.52s, pixel_aot_e64_spellings_warp 1.47s, mesh_entry_cvt_minmax_draw_warp 1.65s, pixel_aot_sdwa_cmp_warp 1.25s, pixel_aot_s_call_hardware 1.32s, pixel_aot_s_call_warp 1.23s, pixel_aot_sdwa_unary_warp 1.37s, pixel_aot_mac_legacy_warp 1.42s, pixel_aot_f16_to_int16_hardware 1.88s, pixel_aot_carry_out_warp 1.30s, pixel_aot_plain_bitscan_hardware 1.69s, pixel_aot_first_bit_hardware 1.70s, pixel_aot_e64_integer_warp 1.29s, pixel_aot_attribute_sampled_warp 0.94s, pixel_aot_sad_hardware 1.30s, pixel_aot_div_fmas_hardware 1.57s, pixel_aot_flat_scratch_hardware 1.62s, mesh_entry_cvt_minmax_draw_hardware 1.59s, pixel_aot_pack_int16_warp 1.19s, pixel_aot_carry_in_hardware 1.41s, pixel_aot_bfm_warp 1.22s, pixel_aot_smem_pointers_warp 1.12s, pixel_aot_e64_approx_warp 1.13s, pixel_aot_integer_nc_warp 1.26s, pixel_aot_pack_b32_warp 1.19s, pixel_aot_pack_int16_hardware 1.56s, pixel_aot_vop1_nops_warp 1.12s, pixel_aot_e64_spellings_hardware 1.78s, pixel_aot_sopp_round_mode_warp 1.40s, pixel_aot_brev_hardware 1.43s, pixel_aot_sdwa_int_compare_warp 1.53s, pixel_aot_sopk_hwreg_warp 1.27s, pixel_aot_frexp_exp_hardware 2.35s, startup_gfx2hlsl_root 1.27s, pixel_aot_swap_hardware 1.78s, pixel_aot_carry_out_hardware 1.57s, pixel_aot_mac_legacy_hardware 1.47s, pixel_aot_uncompressed_export_hardware 1.36s, pixel_aot_sdwa_integer_hardware 1.53s, pixel_aot_sdwa_unary_hardware 1.36s, pixel_aot_bfm_hardware 1.28s, pixel_aot_sdwa_int_compare_hardware 1.38s, pixel_aot_sdwa_cmp_hardware 1.46s, pixel_aot_uncompressed_integer_export_hardware 1.32s, pixel_aot_attribute_hardware 1.27s, pixel_aot_region_scalar_alu_hardware 1.38s, pixel_aot_compressed_export_hardware 1.22s, pixel_aot_region_waits_hardware 1.36s, pixel_aot_pack_b32_hardware 1.10s, pixel_aot_e64_integer_hardware 1.04s, pixel_aot_ds_swizzle_hardware 1.15s, pixel_aot_smem_pointers_hardware 1.22s, pixel_aot_integer_nc_hardware 1.20s, pixel_aot_swaprel_hardware 1.19s, pixel_aot_sample_clamp_controls 1.09s, pixel_aot_sopk_hwreg_hardware 1.15s, pixel_aot_attribute_sampled_hardware 0.98s, pixel_aot_e64_approx_hardware 1.17s, pixel_aot_sopp_round_mode_hardware 1.16s, pixel_aot_vop1_nops_hardware 1.14s, startup_gfx2hlsl_f32_med3_warp 0.89s, startup_shader_cache_key 0.92s, startup_compute_request_offline 0.93s, startup_gfx2hlsl_f32_med3_hardware 0.85s, cpu_aot_avx_int_ymm_minmax 0.59s, startup_gfx2hlsl_fract_draw_warp 0.80s, startup_compute_lds_dual_atomics_a-swap-minmax_hardware 0.49s, startup_gfx2hlsl_fract_draw_hardware 0.77s, startup_gfx2hlsl_float_alu_controls 0.40s, shader_signed_zero_minmax_controls 0.41s, startup_compute_lds_dual_atomics_a-swap-minmax_warp 0.47s, cpu_aot_avx_int_minmax_mul 0.50s, startup_gfx2hlsl_f32_med3_controls 0.30s, startup_gfx2hlsl_int_med3_controls 0.20s, startup_compute_request_disabled_control 0.24s, startup_indirect_draw_indexed_warp 0.12s, startup_gfx2hlsl_fract 0.32s, startup_indirect_draw_warp 0.13s, startup_indirect_draw_indexed_hardware 0.03s, startup_indirect_draw_hardware 0.04s, startup_gfx2hlsl_fract_draw_controls 0.27s, spirv_minlod_fractional_hardware 0.10s, spirv_minlod_fractional_warp 0.10s, pixel_aot_sample_clamp_hardware 4.50s, pixel_aot_sample_clamp_warp 4.20s); skipped (capability, not a pass): startup_indirect_draw_indexed_hardware, startup_indirect_draw_hardware, spirv_minlod_fractional_hardware, spirv_minlod_fractional_warp
  • Windows Python checks: tests/form_coverage_check.py ok (10.3s), tests/mesh_clip_cull_check.py ok (3.6s), tests/mesh_dynamic_geometry_check.py ok (0.2s), tests/mesh_heap_sampler_check.py ok (0.6s), tests/pso_readiness_check.py ok (0.8s), tests/rdna2_tools_check.py ok (2.1s), tests/shader_signed_zero_minmax_check.py ok (0.2s), tests/startup_buffer_address_check.py ok (0.4s), tests/startup_buffer_format_word3_table_check.py ok (0.1s), tests/startup_compute_request_offline_check.py ok (0.4s), tests/startup_compute_store_format_xyzw_check.py ok (0.2s), tests/startup_compute_translate_check.py ok (0.2s), tests/startup_flat_param_check.py ok (0.1s), tests/startup_gfx2hlsl_add_sub_co_check.py ok (0.1s), tests/startup_gfx2hlsl_add_sub_co_ci_check.py ok (0.1s), tests/startup_gfx2hlsl_bit_alu_check.py ok (0.6s), tests/startup_gfx2hlsl_capture_check.py ok (0.9s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.3s), tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py ok (31.1s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.1s), tests/startup_gfx2hlsl_compute_check.py ok (0.4s), tests/startup_gfx2hlsl_cselect_mask_check.py ok (0.1s), tests/startup_gfx2hlsl_cvt_alu_check.py ok (0.2s), tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py ok (0.2s), tests/startup_gfx2hlsl_cvt_pk_int16_check.py ok (0.3s), tests/startup_gfx2hlsl_f32_lg_check.py ok (1.3s), tests/startup_gfx2hlsl_f32_nan_check.py ok (5.1s), tests/startup_gfx2hlsl_fma_mix_check.py ok (0.1s), tests/startup_gfx2hlsl_getpc_refusal_check.py ok (0.1s), tests/startup_gfx2hlsl_handler_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_heap_record_check.py ok (0.2s), tests/startup_gfx2hlsl_image_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_image_get_lod_check.py ok (0.2s), tests/startup_gfx2hlsl_int_med3_check.py ok (0.1s), tests/startup_gfx2hlsl_interp_p2_hi_check.py ok (0.2s), tests/startup_gfx2hlsl_join_symbols_check.py ok (0.2s), tests/startup_gfx2hlsl_loop_constants_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_data_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_overwrite_check.py ok (0.1s), tests/startup_gfx2hlsl_operand_count_check.py ok (0.3s), tests/startup_gfx2hlsl_pack_absdiff_check.py ok (2.6s), tests/startup_gfx2hlsl_pack_b32_f16_check.py ok (0.3s), tests/startup_gfx2hlsl_readfirstlane_recompute_check.py ok (0.1s), tests/startup_gfx2hlsl_readfirstlane_uniform_check.py ok (0.3s), tests/startup_gfx2hlsl_refusals_check.py ok (0.8s), tests/startup_gfx2hlsl_root_check.py ok (0.9s), tests/startup_gfx2hlsl_s_abs_check.py ok (0.1s), tests/startup_gfx2hlsl_s_bitset_check.py ok (0.1s), tests/startup_gfx2hlsl_s_ff0_check.py ok (0.1s), tests/startup_gfx2hlsl_s_ff1_check.py ok (0.1s), tests/startup_gfx2hlsl_s_flbit_check.py ok (0.1s), tests/startup_gfx2hlsl_s_quadmask_check.py ok (0.1s), tests/startup_gfx2hlsl_sad_check.py ok (0.3s), tests/startup_gfx2hlsl_saveexec_same_reg_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_arity_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_brev_fold_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_m0_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_null_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_table_arity_check.py ok (0.4s), tests/startup_gfx2hlsl_sdwa_cndmask_check.py ok (0.2s), tests/startup_gfx2hlsl_sdwa_cvt_check.py ok (0.3s), tests/startup_gfx2hlsl_sgpr_spill_check.py ok (0.2s), tests/startup_gfx2hlsl_shift64_check.py ok (0.2s), tests/startup_gfx2hlsl_sload_const_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_smem_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_sop2_complement_check.py ok (7.3s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (1.1s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.1s), tests/startup_gfx2hlsl_spill_branches_check.py ok (1.0s), tests/startup_gfx2hlsl_swap_check.py ok (0.4s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (4.7s), tests/startup_gfx2hlsl_waitcnt_depctr_check.py ok (0.1s), tests/startup_gfx2hlsl_watch_check.py ok (2.7s), tests/startup_image_2d_array_check.py ok (0.2s), tests/startup_image_3d_check.py ok (0.2s), tests/startup_image_gather_lz_check.py ok (0.6s), tests/startup_image_load_d16_check.py ok (1.0s), tests/startup_image_sample_a16_check.py ok (0.2s), tests/startup_image_sample_b_check.py ok (0.2s), tests/startup_image_sample_c_check.py ok (0.2s), tests/startup_image_sample_l_check.py ok (0.2s), tests/startup_image_sample_lod_check.py ok (0.6s), tests/startup_inline_sampler_check.py ok (0.2s), tests/startup_mesh57_depth_only_check.py ok (0.2s), tests/startup_mesh57_lane_spill_check.py ok (0.3s), tests/startup_mesh57_loop_check.py ok (0.2s), tests/startup_mesh57_loop_refusal_check.py ok (0.2s), tests/startup_mesh57_skeleton_check.py ok (1.2s), tests/startup_run_ps1_check.py ok (16.1s), tests/startup_run_sh_check.py skipped (0.1s), tests/startup_sampler_heap_check.py ok (0.2s), tests/startup_shader_cache_rekey_check.py ok (2.9s), tests/startup_smem_address_check.py ok (0.2s), tests/startup_stream_fetch_check.py ok (0.2s), tests/startup_stream_interface_check.py ok (0.2s), tests/startup_translator_check.py ok (0.5s), tests/vk_offscreen.py ok (1.4s)
  • sccache: 41/90 hits; wall 584.3s

Selection used: minmax|signed_zero|med3|pixel_aot|fract|float_alu|shader_cache_key|indirect_draw|gfx2hlsl_root|compute_request, with offscreen_check rebuilt.

AI-assisted; commands listed were executed locally.

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at head c1689a59 (main merged into the branch since the previously reviewed head 4beb58eb; the min/max logic is unchanged).

Findings

  • P1: none.
  • P2: none.

Checked

  • Since 4beb58eb the only PR-specific change is the update of the four mutations in tests/startup_gfx2hlsl_float_alu_check.py (v_min_f32, v_max_f32, v_min3_f32, v_max3_f32). They match the minmax_zero32 text and flip the same operation as before, so each mutation still changes a draw set.
  • The cache revision is 18 in tools/startup/gfx2hlsl.py and in src/startup_stubs/d3d12_draw.inl. No x2w-startup-shader-17 literal is left in tools, src or tests.
  • The behavior is guarded by D3D12 WARP readback tests (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.
  • The earlier nit about -9 versus -8 is no longer relevant: the revision is now 18 and startup_shader_cache_key_check.py pins it.

Commands run locally (all passed)

  • python3 tests/shader_signed_zero_minmax_check.py -> 20 signed-zero lowering checks reject both helper mutations
  • python3 tests/startup_gfx2hlsl_float_alu_check.py, tests/pixel_aot_check.py, tests/startup_shader_cache_key_check.py -> rc 0
  • python3 tests/docs_links_check.py, python3 tests/bidi_controls_check.py -> rc 0
  • git diff --check origin/main...HEAD -> clean
  • Mutation: changed the NaN mask in tools/shader_minmax.py from 0x7fffffff to 0x7ffffffe. The signed-zero check failed, so it is killed. Reverted.
  • Win2025 WARP, dev and release: ctest selection of 237 tests, 237 passed.

AI-assisted; commands listed were executed locally.

@tedin7
tedin7 merged commit 8016c39 into R0Y00:main Nov 26, 2026
5 checks passed
@thepatrickworld

Copy link
Copy Markdown
Contributor

Independent AMD RDNA 4 result on c1689a59 — post-merge receipt on the merged head; no code change, measurements only.

Environment

  • Head c1689a5984d94df6d61d8c438d1d65ef08b5e79e (merge of main 817396ad, merged at 2026-11-26T03:40:54Z), tracked tree clean, dev preset (Debug), rebuilt with cmake --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; MSVC 19.44.35230.0 (read from out/build/dev/CMakeFiles/4.4.4/CMakeCXXCompiler.cmake); DXC 1.9.2602.17, FXC 10.0.26100.9457.
  • AMD Radeon RX 9070 XT 1002:7550, driver 32.0.32029.2010. The 34 startup draws of the capture print backend=hardware debug_layer=unavailable; the layer could not be enabled here, so nothing below is D3D12 API validation.
  • offscreen_check.exe SHA-256 5ED5E779E60C945825FE736283097114DA44D43003C294161819D13A0C01AE98.

Commands

cmake --build --preset dev --target offscreen_check
ctest --preset dev --no-tests=error -R "^shader_signed_zero_minmax"        # three consecutive runs
python -B tests/shader_signed_zero_minmax_check.py draw   <dxc> <offscreen_check.exe> hardware <fxc>
python -B tests/shader_signed_zero_minmax_check.py plain  <dxc> <offscreen_check.exe> hardware <fxc>
python -B tests/shader_signed_zero_minmax_check.py invert <dxc> <offscreen_check.exe> hardware <fxc>
python -B tests/shader_signed_zero_minmax_check.py plain  <dxc> <offscreen_check.exe> warp     <fxc>
python -B tests/shader_signed_zero_minmax_check.py draw   <dxc> <offscreen_check.exe> warp     <fxc>
ctest --preset dev --no-tests=error -R "transcendental" -V                 # twice
git diff --stat 7949526d HEAD -- tests/shader_signed_zero_minmax_check.py \
    tests/startup_gfx2hlsl_float_transcendental_check.py tests/startup_gfx2hlsl_lane_alu.py   # empty

XBOX2WINDOWS_ADAPTER selected the card.

Observed

1/3 Test #981: shader_signed_zero_minmax_controls ...   Passed    0.39 sec
2/3 Test #982: shader_signed_zero_minmax_warp .......   Passed   13.02 sec
3/3 Test #983: shader_signed_zero_minmax_hardware ...   Passed   19.18 sec
100% tests passed out of 3

The other two runs differ only in durations (0.36 / 12.69 / 19.21 and 0.36 / 12.57 / 19.46), and no capture holds a ***Skipped line. The no-argument arm prints 20 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 invert fails the run if nothing differs.

hardware draw: 0/252 result words differ      (three runs)
hardware plain: 0/252 result words differ
hardware invert: 84/252 result words differ
warp plain: 50/252 result words differ
warp draw: 0/252 result words differ

252 words is 63 rows of four: 29 pixel rows at ps_6_2, 17 startup rows at ps_6_0, 17 at ps_5_1.

What the plain row shows

The plain mutation replaces only the body of minmax_zero32 with maximum ? 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:

hardware pixel ps_6_2 min row 0: 80000000,80000000,80000000,00000000 (expected 80000000,80000000,80000000,00000000)   # draw
hardware pixel ps_6_2 min row 0: 80000000,80000000,80000000,00000000 (expected 80000000,80000000,80000000,00000000)   # plain

So on this card, with this driver and this compiler pair, the plain emission already produces the reference words, and the draw arm cannot separate it from the helper. That the mutation is real is shown by the same script on WARP: 50/252 with plain, 0/252 with draw.

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; plain strips 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's before mode is an alias of draw (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 head startup_gfx2hlsl_float_transcendental_hardware passes in both runs (100% tests passed out of 3), and with this FXC build v_log_f32 at input 0x3e000000 reads c0400000, v_sqrt_f32 at 0x41100000 reads 40400000. The GTX 1060 c03fffff you recorded above does not reproduce on this adapter.

Limits

One adapter, one driver, one compiler pair, no layer validation. I first measured 7949526d and re-ran everything once the head moved to c1689a59 (40 commits between them, tools/startup/gfx2hlsl.py 531 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants