rdna2spirv: support buffer_load_format_d16_hi_x and buffer_store_format_d16_hi_x (OLD-9907) #858
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/858"
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?
Imported from ubiquitarianism/leonida. Originally posted by TanmaySatyam on 2026-11-24T14:41:25Z.
Claimed in the coordination issue as: OLD-9907
Summary
Carries forward
old-pr/9907(carried-over draft #172) onto currentmain(d0da7dade), preserving the original author's (Luiz Neves) commit:rdna2spirv: buffer_load_format_d16_hi_x and buffer_store_format_d16_hi_xSupports
buffer_load_format_d16_hi_x(writes decoded 16-bit result into bits 31:16 ofvdata, preserving bits 15:0, and marksvdataas read inread_before_write_vgprs) andbuffer_store_format_d16_hi_x(reads component from bits 31:16 ofvdata), plus thedocs/design.mdrow andtests/semantic/test_buffer_format_d16_hi.py.Rebase adjustments
self.tou(...)->self.int_bits(...)inGen.buffer_storeto match currentmain.op == "buffer_load_format_d16_hi_x"alongsidemain'sbuffer_load_*d16 condition inread_before_write_vgprs.docs/design.mdtable insertion below currentmain'sTyped buffer formatsrow.Testing & Verification
python -I scripts/check_no_game_data.pyclean on all touched files).spirv-as/spirv-val(--target-env vulkan1.3).python -I tests/semantic/test_buffer_format_d16_hi.py -v: 3/3 OK across all 77 formats inGen.FORMATS(load high-half preservation, store high-half selection across 5 values per format, andread_before_write_vgprs)spirv-as --target-env vulkan1.3+spirv-val --target-env vulkan1.3on translated compute shader exercising bothbuffer_load_format_d16_hi_xandbuffer_store_format_d16_hi_x: PASSpython -m unittest discover -s tests/semantic -p test_buffer_format_narrow_int.py: 3/3 OKpython -I tests/test_docs_links.py: 16/16 OKpython -I tests/test_text_write_line_endings.py: 3/3 OKpython -m compileall -q make_game.py tools tests/semantic/test_buffer_format_d16_hi.py: OKImported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:44:06Z.
Review: APPROVED
Audited and verified. Implements uffer_load_format_d16_hi_x (inserting into bits [31:16] via OpBitFieldInsert while preserving the low 16 bits) and uffer_store_format_d16_hi_x (extracting high half via u16_half/i16_half), correctly registering the destination VGPR as read-before-write in dependency analysis. Contract table updated in docs/design.md. Clean-room compliant. Approved.
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:44:21Z.
Review: APPROVED
Clean-Room Audit & Compiler Verification — PR #858 (
OLD-9907)Great restoration of high-half d16 buffer format operations.
Technical Verification
buffer_load_format_d16_hi_x(extracting high 16 bits viaOpBitFieldInsertinto existing VGPR) andbuffer_store_format_d16_hi_x(storing upper 16 bits) intools/rdna2spirv.py.docs/design.md.tests/semantic/test_buffer_format_d16_hi_x.py.Verdict: APPROVED
Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-25T19:31:23Z.
Review: APPROVED
Approving. Merged into current main (
9f9a7c5) with no conflicts.test_buffer_format_d16_hi.pypasses, and the full translator suite gives 491 files / 6,313 tests with onlytest_int32_to_f64failing, the same baseline failure as main here (Linux, Python 3.13).The load writes the converted value into bits 16-31 with
OpBitFieldInsert(old, r, 16, 16)and keeps the low half. Because of that, addingbuffer_load_format_d16_hi_xtoread_before_write_vgprsis required, and the PR does it. The store and the signed-integer path both take half 1 for the_d16_hi_form, and both ops are added to the opcode lists the dispatch checks.AI-assisted (Claude).
Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-28T10:45:55Z.
#858 | head
3ad34dddc38848ac6c0b2bb573f5ee0a01879458|python3 -m unittest discover -s tests/semantic -p test_buffer_format_d16_hi.py -v| red: 3 run, 1 failure, 462 errors | green: 3 passed | Red → greenThe three test methods iterate over format/fixture combinations. The large baseline error count is the number of subtest events. The merged translator passed the load/store high-half cases.
Captured 924 distinct complete SPIR-V module(s) emitted while rerunning test_buffer_format_d16_hi.py on the merged tree. All assembled and passed spirv-val for Vulkan 1.2 with --allow-offset-texture-operand.
Base
3bd936ecd98995bca3e1da83d5e28d2343001aefwas merged into the recorded PR head for the second run. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Counts include unittest subtest events where applicable. AI-assisted with OpenAI Codex. Batch claim.Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T11:51:49Z.
Merged, thank you @TanmaySatyam! This translator PR (rdna2spirv: support buffer_load_format_d16_hi_x and buffer_store_format_d16_hi_x (OLD-9907)) passed its own tests with main merged in during sodove's verification of this batch, so it went in with the batch.
AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.