OLD-9776: scripts: measure the translator (us per instruction) and compare two tools/ trees #1770
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1770"
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 potatoe0100 on 2026-11-25T11:47:51Z.
Claimed in the coordination issue as: OLD-9776 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7161510791)
What and why
Carries on old PR 9776 by @pes7 (draft #54, branch
old-pr/9776, listed in #17), rebased on currentmainwith the author's five commits kept.The tests check what
tools/rdna2spirv.pyemits but nothing about how long it takes, so a change to the parser or the instruction table can slow a full shader build a lot and still pass.scripts/bench_translate.pytimestranslate()on the hand-written semantic fixtures and on two generated straight-line programs (ALU work ands_nopdispatch), reports best-of-N microseconds per instruction, can compare twotools/trees with interleaved timing (--compare A B), prints JSON, and can fail on--max-slowdown. Standard library only; no game data, LLVM or SPIRV-Tools.tests/test_bench_translate.pycovers the options and error cases. Its baseline numbers are from one machine, so--baseline/--write-baselinelet a run use its own.Tested
python -I tests/test_bench_translate.py: 10 tests OK (Linux, Python 3.13; also OK on Windows 11, Python 3.14).python -I scripts/bench_translate.py --runs 1on currentmain's translator: runs, 52 fixtures timed, 54 compute/mesh listings skipped as designed (they need an FSSM header). Python 3.13, Linux.python -m compileall -q scripts tests: clean.GPUs tested: n/a (no GPU code)
AI-assisted: yes (Claude rebased and tested; the change is pes7's)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T08:03:51Z.
Merged into
main(merge commit73a5f3b10), approved by DadaCap (maintainer). Thanks!Checked before merging: Tested in our local release candidate (main + 41 PRs): translator suite 512 files / 6,442 tests clean, Python suite with no new failure versus main, and 360 s game runs on an RTX 5080 with no regression. The merge was pinned to the head commit that was tested (
f03dfe23a).AI-assisted (Claude Code), posted for DadaCap.