Skip to content

compute: lower binary16 VOP1 rcp, sqrt, exp and rsq - #3220

Merged
R0Y00 merged 3 commits into
R0Y00:mainfrom
Leyukaka:f16-vop1-unary
Nov 28, 2026
Merged

R0Y00 merged 3 commits into
R0Y00:mainfrom
Leyukaka:f16-vop1-unary

Conversation

@Leyukaka

@Leyukaka Leyukaka commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #3219 and #2935. Target branch main. Three commits.

Change (src/gfx1013_compute_native.cpp, src/gfx1013_direct_compute.inl). Direct compute lowers the binary16 VOP1 ops v_rcp_f16, v_sqrt_f16, v_exp_f16 and v_rsq_f16, in the VOP1, VOP3 and SDWA forms. v_log_f16 stays refused, as on main.

  • The lowering:
    • the selected half is widened with legacyF16ToF32;
    • the f32 op is applied: fdiv 1.0 for rcp, then dx.op Sqrt, Exp and Rsqrt;
    • the result is rounded to binary16 with the nearest-even conversion that v_cvt_f16_f32 uses. D[31:16] is kept, or the result is placed per SDWA dst_sel.
  • exp targets the RDNA 2 bound of 0.5 ULP.
    • The shader model 4 exp assembly instruction allows a relative error of 2^-21, which is less than 8 binary32 ULP for a normal result.
    • 70 finite binary16 inputs have an exact 2^x closer than 8 binary32 ULP to a binary16 rounding midpoint. They take their correctly rounded result from a table. The table is generated by tests/f16_exp_midpoints.py from a 90-digit reference, and the test checks it against the C++ array.
    • The exact tie exp2(-25) rounds to +0.
  • rsq targets the RDNA 2 bound of 0.51 ULP. The shader model 4 rsq assembly instruction's relative error of 2^-21 is at most 2^-10 of a binary16 ULP, so the result stays within 0.5 + 2^-10 < 0.51 ULP.
    • Special results are selected from the f16 input bits: a negative nonzero input or a NaN gives a quiet NaN; rsq(+-0) is +-inf and rsq(+inf) is +0.
  • log is left for a follow-up. The shader model 4 log assembly instruction allows an absolute error of 2^-21 on [0.5, 2], which can exceed 0.51 binary16 ULP near 1.
  • The MODE contract of the VOP2 ops applies. DPP and clamp/omod stay refused.

Tests. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 (driver 32.0.16.2101) and DXC from the Windows SDK 10.0.26100, Release, on main a0b45d43 plus these commits.

  • native_f16_alu_ir/_hardware and native_sdwa_f16_ir/_hardware compare against tests/f16_packed_model.py. The inputs cover +-0, +-inf, NaN, denormals, negative and general values, in the VOP1, VOP3 and SDWA forms.
    • rcp, sqrt and exp are compared bit for bit, except that rcp, sqrt and rsq match NaN by class; an exp NaN must be 0x7e00. For exp this includes all 70 table inputs in VOP1 and VOP3, 0x11c4/0x11c5/0x11c6, and abs/neg modifiers onto 0x11c5.
    • rsq must equal the correctly rounded value. The other neighbouring encoding is accepted only when the exact result is closer than 8 binary32 ULP to a midpoint.
    • The special results are compared exactly. The controls check the v_log_f16 refusal in VOP1 and VOP3.
  • ctest -R "f16|dot2|native_direct_container": 70 of 70 pass. On a full build, native_|startup_compute|compile_dxil|f16 passes 452 of 453; native_scalar_lds_hardware fails as on main.
  • Mutation checks by hand:
    • disabling the table selection fails native_f16_alu_ir and _hardware;
    • changing one table entry fails the generator check and both tests;
    • from the first version: swapping the sqrt and exp ops, and returning +inf for rsq(-0), each fail.

Measured with compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests, base and change both on main a0b45d43.

AI-assisted.

@R0Y00 R0Y00 left a comment •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Rebasing exact head d5c37380 over main c1de64a5 conflicts in tests/native_f16_alu_check.py. Keep both interpreter arms in _exec: main's unaryBits.i32(i32 33, ...) for the merged scalar FMA tests (#3187) and this PR's unary.f32 arm for exp/log/sqrt/rsq.

The test helper also needs to survive the rebase. After resolving only the text conflict, native_fma_f16_ir fails with AttributeError: module 'native_f16_alu_check' has no attribute 'same_binary16' because native_fma_f16_check.py still calls it. Please preserve the existing exact same_binary16 comparator for that caller, including signed zero and NaN-by-class behavior. The unary tests can continue to use their own one-ULP comparison where appropriate.

I reproduced the failure with ctest --test-dir <build> --no-tests=error -j1 -V -R '^(native_f16_alu_ir|native_sdwa_f16_ir|native_fma_f16_(ir|controls)|native_packed_f16_controls)$'. Keeping both interpreter arms and restoring the exact comparator gave 5/5 in my Debug trial (e33bee58). The resolution is local; no branch was pushed.

Follow-up on the same local resolution: the five controls passed in both Debug and Release /O2. The separate CTest selection ^native_(f16_alu|fma_f16|sdwa_f16)_hardware$ also passed 3/3 in each build. RTX 4060 Laptop, driver 32.0.16.1656, Windows 11 26200.9974, standalone replay without the debug layer. These receipts are for the local merge resolution, not the current PR head.

@pigalot

pigalot commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

I tried to review d5c37380 over main e9d1d6a0, but the trial merge conflicts in tests/native_f16_alu_check.py. On the main side the conflicting change comes from d6912f58 (#3187, v_fma_f16 / v_fmac_f16 / v_fmamk_f16 / v_fmaak_f16), which landed after this branch's base e582a9a4. The two source files and the other test files merge cleanly.

git fetch origin main "pull/3220/head:review/3220"
git merge-tree --write-tree --name-only origin/main review/3220

Could you merge or rebase onto current main and keep both sets of cases in the test? I'll review the new head after that. I haven't built or run anything at d5c37380 yet, so this isn't a verdict on the change.

This reply was AI-assisted.

@KelboLive KelboLive left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review of PR #3220 — compute: lower binary16 VOP1 rcp, sqrt, exp, rsq and log

Summary

This PR adds support for lowering binary16 unary operations (v_rcp_f16, v_sqrt_f16, v_rsq_f16, v_log_f16, v_exp_f16) in the direct compute path, plus extends SDWA support to these new operations.

Changes reviewed

  • src/gfx1013_direct_compute.inl: New binary16_unary() function; extended lowering for unary ops with proper special-case handling (rsq/log edge cases); updated comment about what's supported.
  • tests/native_f16_alu_check.py: Comprehensive test additions for all new unary operations.
  • tests/native_sdwa_f16_check.py: SDWA support for unary ops, including special result enforcement.
  • tests/f16_packed_model.py: CPU model updates for the new operations.
  • docs/experiments/f16-alu-direct.md: Documentation update.

Assessment

The implementation is thorough and correct:

  • The special-case handling for rsq/log (enforcing RDNA2's exact special results) correctly addresses that D3D Rsqrt doesn't guarantee -infinity for -0, so explicit selection based on source bits is used.
  • SDWA support properly handles the unary instruction encoding difference (VOP1 vs VOP2).
  • Test coverage includes all five new operations with various input patterns including edge cases (zeros, infinities, NaNs).

Verdict: Approve

@Leyukaka

Copy link
Copy Markdown
Collaborator Author

Rebased on main b1e92256; head is now ece04c8b. Both of your points are in:

  • _exec in tests/native_f16_alu_check.py keeps both interpreter arms: main's unaryBits.i32(i32 33, ...) for the scalar FMA tests (shader: lower v_fma_f16, v_fmac_f16, v_fmamk_f16 and v_fmaak_f16 in the direct C++ path #3187), then this PR's unary.f32 arm for exp, log, sqrt and rsq.
  • same_binary16 is back, with main's exact logic (docstring extended): bit equality and NaN by class, so signed zeros stay distinct. tests/native_fma_f16_check.py still uses it. The unary results keep their own comparison through same_half / f16_packed_model.same_half_result, which allows one binary16 ULP for exp, rsq and log.

On this head (RTX 5080, Release, Windows SDK 10.0.26100 DXC):

  • your selection ctest --no-tests=error -j1 -R '^(native_f16_alu_ir|native_sdwa_f16_ir|native_fma_f16_(ir|controls)|native_packed_f16_controls)$' passes 5/5;
  • -R "native_f16|native_sdwa_f16|native_fma_f16|native_cvt_f16|native_packed|native_pk|native_direct_container|native_frexp|native_dpp" passes 41/41, including the _hardware tests.

AI-assisted.

Copy link
Copy Markdown

For the rebased ece04c8b unary coverage, VIctory #3609 has an independently checked v_exp_f16 discriminator: binary16 input 0x11c5 must give 0x3c01 rather than 0x3c00. This exercises exp lowering separately from the rebased FMA interpreter arms. If the standalone test already has a midpoint lane, report that lane's hex result on hardware and WARP separately; the full donor sweep doesn't establish this branch's result.

@Leyukaka

Copy link
Copy Markdown
Collaborator Author

Rebased on main 8007a539 (head 8027ad6e). The only conflict was next to #3236: DPP8 stays refused on binary16, and DPP16 stays refused on these VOP1 forms. The same 41-test selection plus the new DPP8 tests passes (49/49, RTX 5080, Release).

@akimfomin, I checked that midpoint lane with a one-off readback through this branch's direct path on the RTX 5080 (Release):

input result correctly rounded
0x11c4 0x3c00 0x3c00
0x11c5 0x3c00 0x3c01
0x11c6 0x3c01 0x3c01

So 0x11c5 comes out one ULP low. The exact result is only about 0.11 f32 ULP above the binary16 midpoint 1 + 2^-11. So the f32 intermediate lands on or below that midpoint, even when it is correctly rounded, and the nearest-even step picks 0x3c00. It is a double-rounding case. The test allows one binary16 ULP for exp, rsq and log, which is why it passes. WARP cannot run this check: its compute path has no 32-lane waves, so it reports the capability skip.

I would rather try to make these three ops round exactly than keep the tolerance. A second f32 transcendental on the inverse would not be enough, for the same reason. The decision at a binary16 midpoint would need exact comparisons, for example against per-input thresholds, or an exact compare where the inverse allows it, as 1/m^2 does for rsq. If that works out, the test can compare bit-exact, with 0x11c5 among its inputs. Until then, the current tolerance is the honest bound for this PR. Say if a one-ULP bound is acceptable here.

AI-assisted.

Copy link
Copy Markdown

Thanks @Leyukaka. I independently recomputed that midpoint in a 60-digit CPU reference: rounding once gives 0x3c01, and an intermediate f32 rounds to the exact midpoint before f16 produces 0x3c00. The two neighboring lanes and the WARP capability skip in your RTX 5080 receipt make the distinction clear. VIctory #3609 has a narrow exp-only control at this input. It can be reviewed separately from rsq/log and from the PR's broader one-ULP tolerance. I'll record the measured mismatch and its attribution in PortBridge.

Copy link
Copy Markdown

Your 0x11c5 result is now covered by an apply-ready patch. I checked it against both the reported 8027ad6e and current eceb81af; the 340-case upstream CPU model passed on the newly patched head. The fix selects 0x3c01 after input modifiers and checks the two neighboring encodings plus the preserved destination half exactly. Native IR and physical GPU remain to run for the patched head. Would you prefer this exp-only change here or separately? PortBridge evidence.

@Leyukaka

Copy link
Copy Markdown
Collaborator Author

Thanks for checking it on both heads. I would rather not special-case 0x11c5 alone, though.

I counted over every finite binary16 input, against a 70-digit exp2 reference:

  • With a correctly rounded f32 intermediate, 0x11c5 is the only input that rounds to the wrong binary16 value.

  • The host's f32 exp2 does not have to be correctly rounded, though. Several inputs have an exact result close to a binary16 midpoint, counted in f32 ULPs at the result:

    Distance to the midpoint Inputs
    under 0.5 ULP 4 (0x11c5, 0xa86d, 0x36b6, 0xb8a5)
    under 2 ULP 10
    under 4 ULP 26
    under 8 ULP 70
  • A host exp2 that is off by E ULP can round the wrong way any input closer than E ULP to a midpoint; for 2 ULP that is 10 inputs. A select on 0x11c5 only fixes the correctly rounded case. My RTX 5080 readback covered 0x11c4 to 0x11c6 only, not the other three inputs under 0.5 ULP.

Two options I can implement here:

  1. A small table of every input whose exact result lies within the host's exp2 error bound of a midpoint, returning the correctly rounded binary16 for each. The result is then exact on any host within that bound. The bound has to be chosen, for example 8 ULP, which gives 70 entries. This covers exp only; rsq and log keep the one-ULP comparison for now.
  2. Keep the current comparison, which accepts one binary16 ULP on nonzero finite results of exp, rsq and log.

I'll wait for the maintainer's choice. Either way it stays in this PR.

AI-assisted.

@R0Y00

R0Y00 commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Please target the documented RDNA 2 accuracy for this path. The ISA lists 0.5 ULP for V_EXP_F16 and 0.51 ULP for V_RSQ_F16 and V_LOG_F16. The measured 0x11c5 double rounding already crosses the exp bound. A one-encoding-step comparison alone also cannot establish the other two numeric error bounds. RDNA 2 ISA, VOP1 instructions 86–88.

Of the two choices, please pursue the bounded exp correction. Use a documented host error bound for any midpoint table, generate the entries from a high-precision reference, and test 0x11c4/0x11c5/0x11c6 and the other close midpoints with exact GPU bits. Keep the mode, destination-half and special-value controls. If a host bound cannot be established, leave exp refused until the implementation covers the required precision. The same principle applies to rsq/log: keep them in the patch when their actual absolute ULP bound is covered, or carry them in a follow-up so rcp/sqrt can progress independently. This avoids relying on a per-device exception for one observed input.

Independent regression receipt for eceb81a on main fdb6faa, integrated tree 855194f4c009c36a64ea032d557e367b056e47f5: 12/12 in Debug and Release /O2, zero skips. Both scalar FMA IR controls now pass, including the existing binary16 equality helper. RTX 4060 Laptop 32.0.16.1656, Windows 11 26200.9974, standalone replay without the debug layer. Commands:

ctest --test-dir <build> --no-tests=error --output-on-failure -j 1 -R "^(native_(f16_alu|fma_f16|sdwa_f16(_scalar)?|cvt_f16|dpp8)_(ir|controls|hardware)|native_fma_f16_opsel_ir|native_direct_container)$"

This addresses my earlier rebase/helper report. The numerical question above is independent of the passing one-step-tolerance fixture.

@pigalot pigalot 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.

I reviewed eceb81af merged over main fdb6faaa. The merge is clean (tree 855194f4) and git diff --cached --check is clean. It also merges cleanly over 4d7265c0, which only touches startup tests. I first ran everything below on 8027ad6e over 50e4f763. The rebase to eceb81af changes only _exec and refusal_programs in tests/native_f16_alu_check.py; the source and the other files are the same, so I reran the tests but not the mutants.

R0Y00's changes request on d5c37380.

  • _exec keeps all three interpreter arms, in this order: main's unaryBits.i32(i32 33, ...), #3239's unary.f32(i32 7, ...) saturate, then this PR's unary.f32 arm. That last arm only fullmatches opcodes 21/23/24/25.
  • same_binary16 is back with the exact comparator, and native_fma_f16_ir and native_fma_f16_controls pass (in the run below).
  • The formal sign-off is still R0Y00's.

What I traced. binary16_unary joins half_alu in decode and the shared binary16 lowering in DirectCompute, so the MODE contract, clamp/omod and op_sel refusals carry over. The source half is widened with legacyF16ToF32, then:

  • rcp is fdiv 1.0, x;
  • sqrt/rsq/log/exp are dx.op 24/25/23/21;
  • the result is rounded with packed_half_rne, and the high half is kept, or SDWA placement is applied.

For rsq and log, the special-value selects run on the modified source bits, in this order:

  1. ugt 0x7c00 → quiet NaN, which covers positive NaNs and every negative encoding;
  2. +inf → rsq +0, log +inf;
  3. ±0 → rsq source | 0x7c00 (signed infinity), log -inf;
  4. log(1) → +0.

-0 is selected last, so it overrides the NaN select. VOP1 DPP16 and DPP8 are refused in decode.

What I ran. I built native_compute_ir_dump native_store_replay compile_dxil offscreen_check in dev and release, then ran:

ctest --test-dir out/build/<preset> --no-tests=error -j 4 -R 'native_(f16|sdwa_f16|fma_f16|cvt_f16|packed|pk|frexp|dpp|dot2)|native_direct_container' -E '_hardware'
python .agentic\scripts\with_gpu_lock.py ctest --test-dir out/build/<preset> --no-tests=error -j 1 -R '(native_(f16|sdwa_f16|fma_f16|cvt_f16|packed|pk|frexp|dpp|dot2)|native_direct_container).*_hardware'
  • Results: 30/30 non-hardware and 26/26 hardware tests pass in both Debug and Release /O2, with no skips.
    • This includes R0Y00's five-test selection.
    • It includes #3239's native_packed_dot2_f16_*, which shares the _exec interpreter.
    • It includes #3240's native_sdwa_f16_scalar_ir/_hardware, which reuse this file's program/group_offsets with the new STRIDE of 512.
  • Negative control: on main 4d7265c0, the PR's native_f16_alu_check.py ir fails with "direct DXIL lowering for v_rcp_f16". The PR's native_sdwa_f16_check.py ir fails with "unimplemented direct SDWA operand profile".
  • Interaction with #3240: #3240 lets SGPR and inline-constant sources reach these SDWA unary forms, and no test here covers them. I ran a one-off probe of all five ops with SGPR sources (WORD_0 -0, WORD_1 -1, DWORD) and inline 2.0/1.0, with PAD and PRESERVE. All 25 cases match half_op in the IR, and all 50 GPU words match on the RTX 5090.

Mutants. These ran on 8027ad6e. For each, I rebuilt in dev and ran native_(f16_alu|sdwa_f16)_(ir|hardware):

Mutant Result
rsq(±0) always +inf killed (IR and hardware)
sqrt and exp opcodes swapped killed
log(±0) gives NaN killed
rcp numerator 2.0 killed
log(+inf) gives +0 killed
VOP1 DPP16 accepted killed (unsupported v_rcp_f16 DPP form expected, got "unsupported DPP arithmetic")
VOP1 DPP8 accepted (dpp8 limited to VOP2) survives in native_(f16_alu|sdwa_f16|sdwa_f16_scalar|*dpp*)_(ir|controls)

Restored and rebuilt afterwards; git diff --quiet is clean.

Non-blocking.

  1. The VOP1 DPP8 refusal has no test. The description says DPP8 stays refused on these forms, and the code refuses it. But a vop1(op, 3, 233) entry next to the DPP16 refusals would pin it.
  2. A stale comment in #3240's test. native_sdwa_f16_scalar_check.py still says group records start at DWORDs 8 and 136. With STRIDE 512 they start at 8 and 520. The code uses group_offsets, so only the comment is off.
  3. Tolerance. The one-ULP allowance for exp, rsq and log is documented, and so is the exp double-rounding discussion in the thread. rcp and sqrt are compared bit-exact, and they match bit-exact on this NVIDIA driver too. Whether real gfx1013 v_rcp_f16/v_sqrt_f16 are correctly rounded is not measured here.

Verdict: approve on eceb81af. R0Y00's changes request still needs his own sign-off, so I'm not merging.

Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Windows SDK 10.0.28000.0 DXC, Python 3.12.10, wave32 replay; I did not check the debug-layer status.
CI: Build and test on Windows passes on eceb81af.

This reply was AI-assisted.

The direct compute path lowered the binary16 VOP2 ALU ops only. The
three VOP1 ops now take the same route, plain and SDWA: the selected
half is widened with legacyF16ToF32, the f32 op is applied (fdiv 1.0,
dx.op Sqrt, dx.op Exp), and the result is rounded to binary16 with the
nearest-even conversion v_cvt_f16_f32 uses, keeping D[31:16] or placing
it per SDWA dst_sel. The same MODE contract applies. v_rsq_f16 and
v_log_f16 stay refused.

native_f16_alu and native_sdwa_f16 check the three ops against
f16_packed_model: rcp and sqrt bit-exact, exp within one binary16 ULP,
NaN by class.

AI-assisted.
Extends the binary16 VOP1 lowering to v_rsq_f16 (dx.op Rsqrt) and
v_log_f16 (dx.op Log, base 2), plain and SDWA, with the same widen, f32
op and nearest-even rounding. The special results are selected from the
f16 input bits, because the D3D contract does not fix them: a negative nonzero
input (including -inf) or NaN gives a quiet NaN, rsq(+-0) is +-inf, rsq(+inf) is +0,
log(+-0) is -inf, log(+inf) is +inf and log(1) is +0.

The f16 checks compare rsq and log within one binary16 ULP, the special
results exactly and NaN by class.

AI-assisted.
exp: the binary32 exp2 result is rounded to binary16 as before, then
the 70 inputs whose exact result lies closer than 8 binary32 ULP to a
binary16 rounding midpoint take their correctly rounded value from a
table. 8 ULP covers the documented D3D exp relative error of 2^-21.
tests/f16_exp_midpoints.py regenerates the table from a 90-digit
reference and checks the C++ array. The exact tie exp2(-25) rounds to
+0. exp results are now compared bit for bit.

rsq: the documented relative error of 2^-21 is at most 2^-10 of a
binary16 ULP, so the result stays within 0.5 + 2^-10 < 0.51 ULP. The
test requires the correctly rounded value, and accepts the other
neighbouring encoding only within 8 binary32 ULP of a midpoint.

log: v_log_f16 is refused again, as on main. Its documented absolute
error of 2^-21 on [0.5, 2] can exceed 0.51 binary16 ULP near 1.

AI-assisted.
@Leyukaka Leyukaka changed the title compute: lower binary16 VOP1 rcp, sqrt, exp, rsq and log compute: lower binary16 VOP1 rcp, sqrt, exp and rsq Nov 28, 2026
@Leyukaka

Copy link
Copy Markdown
Collaborator Author

Done as you asked: bounded exp, rsq kept, log moved out. Pushed 41d79706 (rebased on main a0b45d43, where it was measured; it also merges cleanly on the current 0fe4cebc). Only the third commit is new, on top of the two earlier ones, so pigalot's approval of eceb81af covers the first two and updated the description.

  • The documented host bound. The Microsoft Learn pages for the shader model 4 exp and rsq instructions give "The maximum relative error is 2-21" (2^-21). log gives an absolute error of 2^-21 on [0.5, 2] and a relative 2^-21 outside it. For a normal binary32 result, 2^-21 relative is less than 8 binary32 ULP.
  • exp. The 70 finite binary16 inputs whose exact 2^x lies closer than 8 binary32 ULP to a binary16 midpoint take their correctly rounded result from a table. tests/f16_exp_midpoints.py generates the table from a 90-digit reference and checks the C++ array. The exact tie exp2(-25) rounds to +0. On the RTX 5080, exact GPU bits are checked for every table input (0x11c4/0x11c5/0x11c6 included) and for all other exp cases. The mode, destination-half and special-value controls are unchanged.
  • rsq. It stays in this PR. A 2^-21 relative error is at most 2^-10 of a binary16 ULP, so the result is within 0.5 + 2^-10 < 0.51 ULP. The test now requires the correctly rounded value, and accepts the other neighbour only within the 8-ULP midpoint window.
  • log. It is refused again, as on main. Near an input of 1, the absolute bound of 2^-21 can exceed 0.51 binary16 ULP, so it needs another approach in a follow-up.

The new mutants and the same-SHA counts are in the description: +8 on the local capture and +1 on the 882 requests.

AI-assisted.

Copy link
Copy Markdown

I compared the exact 70 C++ table entries at 41d79706 with an independent 96-digit CPU reference. All 70 input/output pairs match. With the 2^-21 relative band, 62 of those finite interior inputs need coverage; the conservative table covers them. The exact underflow tie and the runtime results are separate. Reproduction.

I updated PortBridge #155 so an AMD or Intel volunteer can run the existing exact-bit hardware target on this head. A second adapter receipt would complement your RTX result.

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The precision change addresses my earlier review. The generated table covers the finite exp2 inputs near a half rounding midpoint, including 0x11c5. The revised fixture checks the neighboring inputs and exact bits, the rsqrt comparison uses the numeric bound, and the logarithm stays refused. I corrected my earlier wording about the exp limit: the current RDNA 2 guide lists 0.51 ULP. The correctly rounded exp target is within that limit. AMD RDNA 2 ISA, Microsoft Exp, Microsoft Rsq.

At 41d79706 plus main a166a753, Debug and Release /O2 each gave 12/12, including scalar/SDWA binary16, packed FMA and DPP8 regression checks. After #3270, Release /O2 on main fdba6e15 (tree f1c049e3) passed all five focused cases:

ctest --test-dir <build> --no-tests=error --output-on-failure -j 1 -R '^(native_f16_alu_(ir|hardware)|native_sdwa_f16_(ir|hardware)|native_direct_container)$'

No skips. Windows 11 26200.9974, RTX 4060 Laptop 32.0.16.1656, SDK/DXC 10.0.26100.0, standalone replay without the debug layer.

@R0Y00
R0Y00 merged commit e8dd89e into R0Y00:main Nov 28, 2026
5 checks passed
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.

5 participants