Repository navigation
BUILD-2810: shader_disasm: a time limit per llvm-mc call, and ten failures in a row end the run - #7980
BUILD-2810: shader_disasm: a time limit per llvm-mc call, and ten failures in a row end the run#7980Pablo-Barros wants to merge 2 commits into
Conversation
…lures in a row end the run With LLVM_MC set to a WSL command, every wsl.exe call failed after about 16,600 shaders, each after about 100 s, and the tool went on to the next file: about 60 hours for the 9,092 left. llvm-mc was also called with no time limit, so a call that never returned held a worker for good. One call may take LEONIDA_MC_TIMEOUT seconds (120 by default) and is stopped with its child processes when it runs out: wsl.exe starts another wsl.exe that keeps the output pipes open, so subprocess.run(timeout=1) returned after 12 s. Ten shaders in a row with no disassembly, and no listing between them, end the run with one line; the worker that counts the tenth closes the pool. make_game.py resumes from the listings written, as before. AI-assisted (ZCode).
|
(AI-assisted review; reproduced locally on macOS / M1 Pro.) |
|
Windows, synthetic inputs. Tested 4152d04. All seven focused disassembler tests passed on this revision on Windows using a stand-in llvm-mc, including a hung probe, a hung invocation with a child process, consecutive versus separated failures, and resume after interruption. The parent control exceeded my 100-second outer test deadline, so I have no completed parent-suite count. AI-assisted verification · GPT-6.2 Astra Medium |
… answers Review of ItsNotRexed#7980 (azterixx): with more than one worker, a shader still running when the tenth failure closed the pool can answer and write a listing, which zeroed the count. main() then printed the usual "N shader(s) produced no disassembly" and said nothing about the shaders that were never started. The first failure of the run of ten is now kept apart from the count, and the line says how many shaders were not started. AI-assisted (ZCode).
|
Thanks @azterixx, you were right, and the case is now a test: 30 shaders, Commit AI-assisted (ZCode). |
Claimed in the coordination issue as: BUILD-2810 (claimed as a new item in #6910 (comment))
Depends on: builds on none. It changes
tools/shader_disasm.pyand its test, which the open #4843, #6190, #7104, #4210, #7573, #4447, #4588 and #4267 also change, so it will need a rebase onto whichever of them lands first.What and why
shader_disasm.pycalledllvm-mcwith no time limit and reported each failed call as one failed shader before going on to the next file.With
LLVM_MCset to a WSL command (WSL 2.6.3, LLVM 21.1.8) on Windows 11, the shader stage ofmake_game.pydisassembled 16,642 shaders in 13 minutes. Then everywsl.execall waited about 100 s and failed withWsl/Service/0x8007274c. The four workers went on to the next file each time, so the 9,092 shaders left would have taken about 60 hours. I stopped the stage, ranwsl --shutdown, and--stages shaders,pipelinesresumed from the finished listings (BUILD-667). I have not found why WSL stopped answering. Separately, a call that never returns held a worker for good.llvm-mccall may take 120 s.LEONIDA_MC_TIMEOUTgives another number of seconds, and anything but a positive finite number is one ERROR line. A call that runs out of time is one failed shader,llvm-mc did not answer within 120 s; at the probe it is one ERROR line.wsl.exestarts anotherwsl.exe. Withsubprocess.run(timeout=1)on a command that does this, a 1 s limit returned after 12 s, when the child exited. So the call usestaskkill /F /Ton Windows, astools/xcl_compare.pydoes, and a new session withkillpgelsewhere, asscripts/run_wine_tests.pydoes.llvm-mc gave no disassembly for 10 shaders in a row with no listing between them, first <path>: <reason>. ..., and the line says how many shaders were not started. The worker that counts the tenth closes the pool, so the shaders still queued are not started; with more than one worker, the calls in flight end on their own. One failed shader, or a few with listings between them, are reported as before. This is the part that covers the run described above, where each call failed on its own after 100 s.docs/design.md, "Disassembling shaders", states both limits.How 120 s was chosen. Through WSL, while a build was running: over the 30 largest listings of a 1.0.2.1 corpus (25,734 shaders), one
llvm-mccall took at most 5.65 s (mean 0.42 s); over 90 others taken at random, at most 0.20 s.Tested
No GPU is involved. Windows 11 build 26300, Python 3.12.10,
main242968218plus this change.tests/test_shader_disasm.py, each with a fakellvm-mcthe test writes:llvm-mcthat fails every shader ends at the tenth failure, says that two shaders were not started, and the twelfth is never started;--skip-existingrun reuses the listings written before the run ended;LEONIDA_MC_TIMEOUTmust be a positive number of seconds, and it is read from the environment.python -I tests/test_shader_disasm.py: 37 tests OK, three runs in a row (36 before the commit for the review below).tests/test_bvh_shaders_stage.py(13),tests/test_fspx_shaders_stage.py(22),tests/test_fssm_crosscheck.py(6) andtests/test_first_light.py(47, 4 skipped): OK.tests/that CI runs withpython -I, at4152d045(the commit after it changes only this tool and its test): 443 files, 416 pass and 27 fail on this machine. The same 27 fail onmainwithout this change; none is new.python -m compileall -q make_game.py tools tests: OK.python -I scripts/check_no_game_data.pyon the three changed files: OK.llvm-mcof WSL (LLVM 21.1.8) on 80 shaders of my own copy, the listings are byte for byte those ofmain242968218.AI-assisted: yes (ZCode)
Checklist
docs/design.md, with how it was confirmed. Not applicable: no translator rule changes.