mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:45:54 +01:00
[PR #1908] rdna2spirv: model atomic VGPR reads and writes in liveness analyses (SHADER-RBW-ATOMIC-DATA) #1918
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1918
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1908
Author: @JordanWebDev
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:contrib/rbw-atomic-data📝 Commits (1)
e0f7d8ardna2spirv: model atomic VGPR reads and writes in liveness analyses (SHADER-RBW-ATOMIC-DATA)📊 Changes
3 files changed (+198 additions, -14 deletions)
View changed files
📝
docs/design.md(+1 -0)➕
tests/semantic/test_rbw_atomic_data.py(+157 -0)📝
tools/rdna2spirv.py(+40 -14)📄 Description
Claimed in the coordination issue as: SHADER-RBW-ATOMIC-DATA
What and why
read_before_write_vgprs(),interp_ij_analysis(), andreg_reads_writes()intools/rdna2spirv.pypreviously treated onlyVGPR_READ_ONLY_PREFIXES(plusglobal_atomic_withoutglcinread_before_write_vgprs()only) as read-only ona[0]:buffer_atomic_*,image_atomic_*,flat_atomic_*, non-_rtnDS atomics, andds_store*were treated as overwritinga[0]without reading it, causing pixel shaders whose first touch of entry barycentrics (v0/v1) is e.g.buffer_atomic_add v0, ...to omit loading%bary(sending 0 to the atomic and downstream exports) and falsely triggering computed-I/JPerVertexKHRlowering ininterp_ij_analysis().buffer_atomic_*andimage_atomic_*(glc) also reada[0](including multi-VGPRcmpswap/_x2data pairs) before overwritinga[0]with the prior value.interp_ij_analysis()andreg_reads_writes()also lackedglobal_atomic_non-glchandling.Changes:
"ds_store"toVGPR_READ_ONLY_PREFIXESand introduced shared helpers_vgpr_reads_all(op, mods)and_vgpr_dst_also_read(op, mods)intools/rdna2spirv.py, applied uniformly acrossread_before_write_vgprs(),interp_ij_analysis(), andreg_reads_writes()(including fulla[0]multi-register rangerange(a[0]["r"], a[0]["r"] + a[0].get("n", 1))when returningbuffer_atomic_*/image_atomic_*orDST_ALSO_READreadsa[0]).tests/semantic/test_rbw_atomic_data.pywith CPU fragment execution (spirv_mini_interp) for non-glcandglcPS barycentricbuffer_atomic_add,interp_ij_analysisPerVertexKHRdiscrimination, and unit coverage acrossbuffer_atomic_*,cmpswap,_x2,image_atomic_*(vector & NSAvlist),global_atomic_*,flat_atomic_*,ds_store*, and non-_rtn/_rtnDS atomics.Atomic VGPR operand liveness (SHADER-RBW-ATOMIC-DATA)row todocs/design.md.Tested
git diff --cached --check-> exit 0python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/semantic/test_rbw_atomic_data.py docs/design.md-> exit 0python -I tests/semantic/test_rbw_atomic_data.py-> Ran 5 tests in 0.039s OKpython -I -m unittest discover -s tests/semantic -p "test_store_liveins.py"-> Ran 4 tests in 0.061s OKpython -I -m unittest discover -s tests/semantic -p "test_interp_computed_ij.py"-> Ran 22 tests in 0.420s OKpython -I -m compileall -q make_game.py tools tests-> exit 0python -I make_game.py --help-> exit 0python -I tests/test_text_write_line_endings.py(3 OK),tests/test_report_paths.py(22 tests, 1 skipped, OK),tests/test_docs_design_rows.py(5 OK),tests/test_docs_repo_paths.py(3 OK),tests/test_docs_repeated_lines.py(2 OK),tests/test_ci_registration.py(16 OK)python -I scripts/run_semantic_tests.py tests/semantic-> 490 files, 6293 tests, 0 files failed in 196 s with 16 jobsGPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.