No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!277
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/277/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@LooperSalty on GitHub · 2026-11-26 00:10 UTC · original
LooperSalty:integration/prs-2026-11-26→main· +2637 −115 · 45 files · 23 commits · merged 2026-11-26 00:15 UTCIntegrates the contributor PRs reviewed as ready. Each contributor commit is kept with its author through
git merge --no-ff; nothing is squashed or rebased. Merging this PR marks those PRs merged on GitHub, since their commits land inmain.Included (in merge order)
v_bfe_i32reads copies of the sign bit when the field runs past bit 31v_cmp[x]_*_f16,v_cmp[x]_class_f16) in the HLSL recompilerv_floor/ceil/trunc/rndne_f16in the RDNA 2 interpreterv_fract_f16,v_frexp_mant_f16,v_frexp_exp_i16_f16in the RDNA 2 interpreterv_cvt_pkrtz_f16_f32in the RDNA 2 interpreterv_floor/ceil/trunc/rndne_f16in the HLSL recompiler (its copy of #245 was deduplicated by git)s_version,s_atc_probe,s_atc_probe_bufferin the RDNA 2 interpreter and HLSLv_rndne_f32in integer HLSL to avoid the NVIDIARound_nefolding bugv_add/sub/subrev_nc_u32and the carry-out add/subDropped: none.
Conflict resolution
mainside during the merges, then fixed once in the final commit.PrototypeScarlett/emu/rdna2_exec_f16.py(#246 vs #245/#247): both hunks kept.PrototypeScarlett/emu/rdna2_hlsl.pyandrdna2_hlsl_wave64.py(#232 vs #250): both dispatch branches (COMPAREF16,rdna2_hlsl_int16) and both helper sets kept.README counts (old -> new, same values in the 9 READMEs)
rdna2_exec.coverage()on the merged tree); "GPU instructions" 82% -> 86%tests/test_readme_sync.pyexpects 1600+)Images
carte-avancee.svgandtraduction.svgare not regenerated: their counts (GDK, translation) do not move with these PRs.Test results (merged tree, main checkout venv)
pytest -q: 1342 passed, 323 skipped (runtime not built locally), 0 failed. Before the count fix, onlytest_claimed_count_matches_suitefailed (1500+ announced, 1600+ expected).python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools: all checks passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01LwHrL4bPjrVJiDKC8BDYfz
- VOP3 16-bit ops: v_add/sub_nc_{u16,i16}, v_mul_lo_u16, v_lshlrev_b16, v_lshrrev_b16, v_ashrrev_i16, v_max/min_{u16,i16}, v_mad_{u16,i16}, v_min3/max3/med3_{u16,i16}. op_sel[0-2] read the high half of a source, op_sel[3] writes D[31:16], the other half of D is kept; clamp saturates add/sub/mad to the type's range. - v_mad_u32_u16 / v_mad_i32_i16: op_sel[0-1] pick the source halves, clamp saturates the 32-bit sum; op_sel[2]/op_sel[3] (32-bit S2 and D) refused. - v_cvt_pk_u16_u32 / v_cvt_pk_i16_i32 (saturating packs) and v_add/sub_nc_i32 (clamp saturates signed). - Packed VOP3P: v_pk_{add,sub,mad}_{u16,i16}, v_pk_mul_lo_u16, v_pk_{max,min}_{u16,i16}, v_pk_{lshlrev,lshrrev}_b16, v_pk_ashrrev_i16; op_sel / op_sel_hi pick each half, clamp saturates add/sub/mad and is a no-op on max/min. - Constants are their 32-bit value split like a register (inline integers sign-extended, inline floats their float32 bits, a literal its whole dword). Sources: AMD RDNA 2 ISA (November 2020) sections 12.10 and 12.12 (pseudocode, "Supports saturation", op_sel[3] on v_mad_u16/i16 preserving the other half), 13.3 tables 82 and 86 (OPSEL), 6.2.5 (opcodes usable with OPSEL) and 6.5 (integer clamp saturates to the representable range). Cross-checks from LLVM 20.1.8: GCNSubtarget.cpp ("On gfx10, all 16-bit instructions preserve the high bits"), the uaddsat/usubsat/saddsat/ssubsat CodeGen tests (GFX10 selects the saturating add/sub to these ops with clamp, v_sub_nc_i16 signed), AMDGPUBaseInfo.cpp getInlineEncodingV216 and add.v2i16.ll (constants). The two packs follow Mesa's pack_uint_2x16 / pack_sint_2x16 ("clamp is applied"), which ACO emits as these opcodes; assumed, to be measured (akimfomin/PortBridge#84), like a 32-bit literal read through op_sel on a VOP3 16-bit op. Refused by name: VOP3 abs/neg/omod and VOP3P neg_lo/neg_hi on these integer ops; clamp on v_mul_lo_u16, v_pk_mul_lo_u16, the 16-bit shifts, VOP3 min/max, min3/max3/med3, the packs and the packed shifts; op_sel[2]/[3] on v_mad_u32_u16 / v_mad_i32_i16; op_sel on the packs and on v_add/sub_nc_i32. HLSL: integer-only expressions; the signed 16-bit saturating add/sub is computed from sign bits because clamp(Sext16(a) + Sext16(b)) then a 16-bit mask let the sign-extended high half reach the destination on an RTX 4060 Laptop GPU (WARP and Intel UHD were right). The int16 helpers (AddSatI16, AddSatI32...) are part of the compute, wave64 and graphics (vertex/pixel) HLSL; a vertex shader test runs the helper-backed ops on the GPU. Interpreter coverage 1,208 -> 1,248 of 1,490 encodings (README 81% -> 84%), test count 1400+ -> 1500+. New tests in tests/test_rdna2_exec_int16.py (hand-worked expectations, refusals) and tests/test_rdna2_hlsl_int16.py (byte-for-byte GPU parity in wave32 and wave64 under a partial EXEC). Co-Authored-By: Claude Opus 5.5 <[email protected]>The 18 encodings buffer_load/store_format_d16_{x,xy,xyz,xyzw,hi_x} and tbuffer_load/store_format_d16_{x,xy,xyz,xyzw} now run in the reference interpreter and translate to HLSL, on top of the 32-bit typed formats of #150. - Packing (RDNA 2 is packed d16): component i goes to VGPR VDATA + i/2, low half first; _d16_x and the third component of _d16_xyz write bits 15-0, _d16_hi_x bits 31-16, and the other half is kept. ISA section 8.1.2 (p. 56), 8.1.4 (p. 59), 8.1.6 (p. 64), 12.14 (p. 211, 215: "D0[15:0] = MEM[ADDR]", "D0[31:16] = MEM[ADDR]"); AMD RDNA 2 XML ("low/high 16 bits of a 32-bit vector register"); LLVM 20.1.8 FeatureUnpackedD16VMem only on GFX8. - Loads (section 8.1.4: "data returned from the texture unit is converted to 16 bits"): integer formats of 16 bits or less keep the low 16 bits. UNORM and SNORM round the exact quotient c / (2^n - 1) once to float16, nearest even, subnormals kept (16_UNORM 0xFFAF -> 0x3BFD, 0xFFEF -> 0x3BFF, 16_SNORM 0x7FF7 -> 0x3BFF, 0x8009 -> 0xBBFF, where narrowing the float32 would be one ulp above). 32-bit float formats narrow toward zero, finite values past the range giving 65504, a NaN keeping its sign and top 10 payload bits (payload 1 if those are zero). No public source covers either rule (the ISA only says the data "is converted to 16 bits"), so both are assumed and asked in akimfomin/PortBridge#85. SCALED values go float32 -> float16 to nearest even, overflow to infinity (assumed). 32-bit integer formats are refused by name (truncation or clamping is not documented). - Stores widen each half to the value the non-d16 store takes (UINT zero-extended, SINT sign-extended, float16 -> float32 exact, 16-bit FLOAT copied), then reuse #150's saturation. UNORM/SNORM/SCALED stores stay refused. - HLSL uses integer operations only for the float16 conversions, the exact quotient by long division (no double: Intel UHD has no FP64). Interpreter coverage 1,208 -> 1,226 of 1,490 encodings (README 81% -> 82%); test count still 1400+. New tests in tests/test_rdna2_exec_format_d16.py (hand-computed values, an exact-fraction oracle for every 2- to 16-bit normalized field, Python's binary16 rounding and a toward-zero oracle for the float narrowing) and tests/test_rdna2_hlsl_format_d16.py (byte-for-byte GPU parity in wave32 and wave64). The coverage test of tests/test_rdna2_exec_format.py now requires the 18 d16 forms too. Co-Authored-By: Claude Opus 5.5 <[email protected]>The interpreter and the HLSL BfeI32 helper shifted S0 as unsigned before masking and sign-extending the field. With offset + width > 32 the bits above bit 31 were zeros instead of copies of the sign bit: 0x939108F5, offset 16, width 31 gave 0x00009391 instead of 0xFFFF9391. The ISA pseudo-code shifts the signed S0 ("D.i = (S0.i >> S1.u[4:0]) & ...", section 12.12, p. 169), as s_bfe_i32 already does in this interpreter (section 12.1, p. 105). Both now shift arithmetically; fields inside S0 (offset + width <= 32) are unchanged. Found by differential testing against LLVM's constant folding of llvm.amdgcn.sbfe: 23 of 256 random triples differed, 0 now. Co-Authored-By: Claude Opus 5.5 <[email protected]>@chatgpt-codex-connector[bot] on GitHub · 2026-11-26 00:10 UTC · original · edited 2026-11-26 00:13 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
f08baeaℹ️ About Codex in GitHub
Your 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.
@ -12,3 +12,3 @@HELPERS = "\n".join((ALU_HELPERS, rdna2_hlsl_wide.HELPERS, rdna2_hlsl_div.HELPERS, rdna2_hlsl_image.HELPERS,rdna2_hlsl_format.HELPERS, rdna2_hlsl_dot.HELPERS,rdna2_hlsl_sad.HELPERS, rdna2_hlsl_f16.HELPERS))rdna2_hlsl_sad.HELPERS, rdna2_hlsl_f16.HELPERS, rdna2_hlsl_int16.HELPERS))@chatgpt-codex-connector[bot] on GitHub · 2026-11-26 00:13 UTC · original
For vertex or pixel shaders containing
v_cmp_class_f16orv_cmpx_class_f16, the shared translation body now emits a call toClassF16, but this helper bundle omitsrdna2_hlsl_cmpf16.HELPERS. I reproduced both graphics translators returning HLSL containing the call without its definition, whereas the compute translator includes it. Python translation therefore succeeds, but subsequent runtime shader compilation fails. Include the comparison helpers here and add a graphics-stage parity test against the interpreter.AGENTS.md reference: AGENTS.md:L53-L53
Useful? React with 👍 / 👎.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-26 00:13 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
f08baea868ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".