[rocjitsu] Calibrate cdna4 V_CMP/V_CMPX TRAPSTS and BitExactEmpirical mode #17189
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.57) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 643 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.387
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #17189"
general
weight: 0.35
kuhar
Motivation
#16890 calibrated
gfx950(cdna4) floating-point comparisons numerically while leavingV_CMP_andV_CMPX_on unsuffixedrj_arith_v_cmpentry points withoutgfx950TRAPSTS.EXCPqualification (BitExactEmpiricalmode 3 rejected, andCompatibilityinheritinggfx12whole-wave nonfinite gating rather than MI350X'sMODE.DX10_CLAMPcontract).Replaying
48V_CMP__F{16,32,64}operations across6MODEconfigurations (ieee1_dx0_rne_allow0x2f0,ieee1_dx0_rne_flush0x200,ieee0_dx0_rne_allow0x0f0,ieee1_dx0_rtz_allow,ieee1_dx0_rne_ovfl1, andieee1_dx1_rne_allow0x3f0;294,912Wave64 lanes) plusV_CMP_EQ_F32andV_CMP_LT_F16SDWAsweeps (24,576lanes) on physical MI350X (AMD Instinct MI350X OAM,gfx950, ROCm 7.2.4 / HIP 7.2.53211;319,488total lanes) establishes one uniform hardwareTRAPSTS.EXCPrule with0 / 319,488mismatches:MODE.DX10_CLAMP == 1(!(flags & RJ_ARITH_FP_DX10_CLAMP_OFF)): Suppresses allV_CMP/V_CMPXTRAPSTS.EXCPbits (0x00), regardless ofCLAMP,MODE.IEEE, sNaNs, or subnormals.MODE.DX10_CLAMP == 0(flags & RJ_ARITH_FP_DX10_CLAMP_OFF): Every active lane across all 16 predicates — including constantV_CMP_F_F/V_CMP_TRU_F(V_CMPX_F_F/V_CMPX_TRU_F) — evaluatesfloat_compare_exceptions<Bits>:-
sNaNraisesINVALID(0x01);CLAMP = 1promotesqNaNto raiseINVALID(0x01).- Unflushed finite subnormal pairs raise
INPUT_DENORM(0x02); pairing a subnormal with±InforNaNsuppressesINPUT_DENORMfor that lane.In addition, two shared execution-bridge helpers (
execute_packed_fma32/execute_packed_binary32inrj_arith_packed_f32_exec.handexecute_fmac64/execute_literal_fma64inrj_arith_fma64_variants_exec.h) previously passednullptrfortrapstsor discarded the returnedstatebits instead of publishing them on success.Technical Details
rj-arith(lib/arith/include/rj_arith/detail/rj_arith_compare.h,lib/arith/src/compare/float_compare_gfx950.cpp,lib/arith/COVERAGE.md):- Add
192rj_arith_v_cmp{,x}_{f,lt,eq,le,gt,lg,ge,o,u,nge,nlg,ngt,nle,neq,nlt,t}_f{16,32,64}_w{32,64}_gfx950entry points resolvingCompatibilitytoBitExactEmpirical(mode 3), gatingTRAPSTSaccumulation onRJ_ARITH_FP_DX10_CLAMP_OFF(downgrading to fast AVX2/AVX-512 numeric dispatch whenDX10_CLAMP == 1), and evaluatingfloat_compare_exceptionsacross all 16 predicates whenDX10_CLAMP == 0.rj_arith_compare.py,rj_arith_compare_exec.h, regeneratedcdna4/{vopc,vop3}_exec.cpp,rj_arith_packed_f32_exec.h,rj_arith_fma64_variants_exec.h):- Route
cdna4V_CMP_/V_CMPX_FP16/FP32/FP64 encodings to_gfx950withRJ_ARITH_FP_DX10_CLAMP_OFFandgfx950_constant_compare_reads_inputs(...)so constantF/TRUpredicates observe operands when reporting withDX10_CLAMP == 0.- Pass
&causesinexecute_packed_fma32/execute_packed_binary32and commitTRAPSTS/ ALU causes on successfulwrite_vector64_resultacrossrj_arith_packed_f32_exec.handrj_arith_fma64_variants_exec.h.Issue Tracking
Follow-up to #16890, #16740, and #13670 (
rj-arith).Test Plan
rj-arithunit tests (lib/arith/tests/compare/float_gfx950_test.cpp):- Add
192per-entry-pointCompareCmpGfx950.Arithmetictests covering all CPU levels, all 5 semantics modes,DX10_CLAMP,CLAMP, input flush, nonfiniteINPUT_DENORMsuppression, source/destination aliasing, andDPP8/DPP16.amdisacodegen tests (lib/python/amdisa/tests/test_rj_arith_compare_codegen.py):- Verify
cdna4_gfx950bindings,RJ_ARITH_FP_DX10_CLAMP_OFFwiring, andgfx950_constant_compare_reads_inputsgating.tests/gfx950_compare_test.cpp):- Add
Gfx950ComparisonTest.MasksDx10ClampTrapstsAndBitExactEmpirical(VOPC,VOP3CLAMP/op_sel,CMPX, andSDWAacrossMODEstates coveringIEEE,DX10_CLAMP, and denormal preserve/flush across all 5ArithmeticSemantics) andGfx950ComparisonTest.PackedF32BridgeCommitsCausesAndRejectsCleanly.Test Result
Verified on Linux x86-64 Zen 4 (
AMD EPYC 9B14,rj_arith_cpuinfo = 0x3 (x86-64-zen4)):ctest --test-dir build-arith-dbg/lib/arith -R baseline_linkage:2 / 2passed (1.70s)ctest --test-dir build-rj/lib/arith(Release,-fno-exceptions,-DRJ_ENABLE_EXPENSIVE_CHECKS=ON):3,831 / 3,831passed (100%,32.92s, including192newCompareCmpGfx950.Arithmetictests)ctest --test-dir build-rj(Release,-fno-exceptions,-DRJ_ENABLE_EXPENSIVE_CHECKS=ON):19,626 / 19,626host-runnable tests passed (100%, includingGfx950ComparisonTest.MasksDx10ClampTrapstsAndBitExactEmpiricalandGfx950ComparisonTest.PackedF32BridgeCommitsCausesAndRejectsCleanlyin0.11seach)pytest lib/python/amdisa/tests:6,361 passed, 41 skipped(40.01s)Submission Checklist