Repository navigation
Conversation
|
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
AI-assisted; commands listed were executed locally. |
|
Ready for review: head 9ad6062, Win2025 dev and release 2/2 by name (startup_gfx2hlsl_f16_cmp_draw_controls and _warp), independent pre-review passed. @MasterDomino AI-assisted; commands listed were executed locally. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ad606296c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
All three review findings on
Verification: AI-assisted; commands listed were executed locally. |
|
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
AI-assisted; commands listed were executed locally. |
|
Independent AMD RDNA 4 result on Not a code change; measurements only. The body lists the real-GPU run as "RunPod real GPU: pending" and the receipts in this thread are WARP, so this is that run on one adapter. EnvironmentRecorded on the machine at run time (
Commands
ObservedThe renderer prints the adapter and the device it opened on every invocation of that entry: Inside the hardware entry, per compiler: Counted from the log, inside that entry: for fxc and for dxc, 15 Both compiler paths of the fixture ran — RegressionSame worktree, one prefix wider ( What this adds over the WARP receipts
Limits
AI-assisted; runs executed on the machine above. |
|
@thepatrickworld thank you, this is a useful independent measurement. What it confirms on
We also note your limits: one adapter, Debug preset only, no AI-assisted; commands listed were executed locally. |
|
Withdrawn: shader translation is moving to the native C++ frontend (see #870), so we are not continuing this change to the Python translator. The branch stays available if any part is useful later. Thank you to everyone who reviewed and tested it. |
Part of #1723
What this unblocks: pixel and vertex programs that compare binary16 values with
v_cmp_<relation>_f16(e32 into VCC, e64 into an SGPR) no longer stop at the first compare.Source: AMD RDNA 2 instruction set architecture guide, the VOPC compare instructions (
v_cmp_<relation>_f16: IEEE ordered/unordered meaning of each relation, 16-bit sources read from the low half); HLSLf16tof32.What changed
tools/startup/gfx2hlsl.pycompare():v_cmp_<rel>_f16andv_cmpx_<rel>_f16for the relations the table already lowers for binary32 (lt, eq, le, gt, lg, ge, o, u, nge, nlg, ngt, nle, neq, nlt, f). The operands are read with the existinghalf_operand(low half of the register, or a binary16 inline constant, with abs/neg).tests/startup_gfx2hlsl_f16_cmp_draw_check.py(new, registered in CMake for WARP and hardware): the compiled pairs are drawn and every result word is compared with a CPU reference.Why it is correct
A half converts to binary32 exactly: every finite half, denormals included, is a normal binary32, and infinities and NaNs stay what they are. So the relation of the two converted values is the relation of the halves, with the same IEEE rules as the binary32 compares already in the table (ordered relations are false with a NaN, the negated ones true). The ordered test of
o,u,nlt,nle,ngt,nge,lgandnlglooks at the half words ((w & 0x7fff) <= 0x7c00), not at binary32 bits. An inline constant is never a NaN.What stays refused
SDWA forms (open #1680),
clamp,op_seland any other modifier, andv_cmp_tru_f16(as for binary32).Test design
Fifteen relations x 40 input pairs (+0, -0, 1.0, -1.0, +inf, quiet NaN in all combinations, plus denormals, adjacent halves, the largest finite half, signalling NaNs and NaNs with payloads and a negative sign). Even lanes use the e64 spelling into an SGPR, odd lanes the e32 spelling into VCC, each followed by
v_cndmask_b32so the mask bit becomes 1.0 or 0.0. Every source word has garbage in its upper half. Six mutants of the translated shader (< as <=, >= as >, a negation removed twice, the NaN test forced to ordered twice, exchanged sources) must each differ from the reference.Verification
python3 -B tests/startup_gfx2hlsl_f16_cmp_draw_check.py(controls) okpython3 -B tests/startup_gfx2hlsl_f16_cmp_draw_check.py binary llvm-mc-19(fixture words match llvm-mc) okstartup_gfx2hlsl_f16_alu_check.py,startup_gfx2hlsl_cmp_class_f16_check.py,startup_gfx2hlsl_f32_lg_check.py,startup_gfx2hlsl_f16_alu_draw_check.py(controls) okremote_pycheck.sh <worktree> --compare origin/main: only the new check differsc9439d04, tests by name: dev 2/2 and release 2/2 (startup_gfx2hlsl_f16_cmp_draw_controls,startup_gfx2hlsl_f16_cmp_draw_warp), plustests/startup_gfx2hlsl_mask_data_check.py; receipt in the comment thread.eq/le/ge/neqkeep the NaN guard (same-source draws), lane-mask sources of the f16 compares are refused, note indocs/experiments/startup-gfx2hlsl-f16-vopc.md.c9439d04:startup_gfx2hlsl_mask_data_controlsandstartup_gfx2hlsl_f16_cmp_draw_controlspassed; the two draw tests (..._warp,..._hardware) hit the 1800 s limit twice, with no mismatch reported. The same limit is hit by the existingstartup_gfx2hlsl_f16_alu_draw_warpand..._hardwarefrom main on that runner, so the draws are not completing there for a reason outside this PR. The same draws pass on Win2025 (D3D12 WARP).AI-assisted; commands listed were executed locally.