shader_ir: preserve symbolic branch and call targets #3215
No reviewers
Labels
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!3215
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3215"
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?
@merzleckeier on GitHub · 2026-12-02 19:43 UTC · original
merzleckeier:fix/shader-ir-branch-label-modifiers→main· +21 −1 · 2 files · 1 commits · merged 2026-12-03 16:10 UTCClaimed as SHADER-IR-BRANCH-LABEL-MODIFIERS, following the parser finding.
What and why
shader_ir.parse_line()scans operand text for modifiers. On scalar branches and calls this can consume symbolic target text such asdone,.done,glc, andvm. Keep that text in the operand list by skipping modifier extraction for those instructions. Numeric offsets still parse as immediates, and export instructions still parsedoneandvmas modifiers.Tested
mainparser (b41763227) and passed with the fix. Both parser test modules passed on Linux and with Windows CPython 3.12.10 under Wine 11.22 (44 tests each).llvm-mc -show-encodingaccepted all four hand-written target forms and the export modifier control forgfx1030.python -I scripts/run_semantic_tests.py tests/semantic -j 8 --timeout 300: 560 files, 6,791 tests, zero failed files.git diff --checkand the changed-filescripts/check_no_game_data.pyscan passed.GPUs tested: n/a (synthetic CPU-only parsing and translator tests).
AI-assisted: OpenAI Codex (GPT-6), with independent read-only review by GPT-6.2 Sol.
Checklist
main(b41763227).@fiestorra on GitHub · 2026-12-02 20:36 UTC · original
VERIFY-3215 — Windows nativo,
red then green(4 subcasos fallan sin el arreglo)(this PR)b41763227= currentmainRan
Negative control (
tools/shader_ir.pyreverted tomain, the PR's tests kept):The fix reads right and is scoped:
if rest and op not in ("s_branch", "s_call_b64") and not op.startswith("s_cbranch_")— scalar branches and calls have no trailing modifiers, so a word such asdone,glcorvmin the target position is the target, not a modifier. The second test the PR adds (test_export_still_parses_done_and_vm_modifiers) is the guard for the other side — the export syntax, where those same words are modifiers — and it passes on bothmainand this head, which is exactly what a guard should do.What I could not test: a real shader corpus through
shader_ir.py; the suite is unit-level (5 tests, no I/O). The four subcases ares_cbranch_scc1 done ; plain comment,s_branch .done,s_cbranch_execz glcands_call_b64 s[0:1], vm.Verdict: red then green on native Windows.
Written with an AI assistant.
@lixonik on GitHub · 2026-12-02 22:47 UTC · original
Windows native verification (
red -> green) -- PASS on headd0fc19927(merged cleanly viagit merge --no-ffontomain16243cd6e).Checks (Windows 10 x64, Python 3.12)
python -I scripts/check_no_game_data.py-> PASSpython -I tests/test_shader_ir_parse.py -von merged headd0fc19927): Ran 5 tests in 0.001s / OKtools/shader_ir.pytomain16243cd6e, keeping the PR'stests/test_shader_ir_parse.py): Ran 5 tests in 0.002s / FAILED (failures=4)AI-assisted: yes (Antigravity -- Gemini 4 Neon).