ProjectScarlett start menu: compute roots, faster compiles, watchdog pause #216
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/brcly--TuxBox!216
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-216"
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?
@bbijsterbosch on GitHub · 2026-11-26 08:50 UTC · original
bbijsterbosch:projectscarlett/start-menu→main· +1667 −103 · 57 files · 12 commits · merged 2026-11-26 11:19 UTCSummary
With this branch, ProjectScarlett 1.0.2.1 boots to its start menu on an NVIDIA laptop GPU under GE-Proton11-14. When the menu was up, no stand-in pipeline was bound (
null usage … compute=0 raster=0).Stand-ins remain during boot. 288 distinct stages had no translation (207 compute, 45 pixel, 32 mesh, 4 vertex). With the default 20 s deadline, many large compute pipelines also returned a stand-in while their driver compile went on.
The run used these twelve commits on
ac4f099. They are now rebased ontomain(773278a) without conflicts. Each commit builds on its own and passes the translator tests. The only addition to the build that ran is a one-line test fix (a missingstridesfield in an inline-arena test initializer).Translator (
xshader)s_getpc/s_add_u32/s_addc_u32/s_setpclong jump with a provable target becomes a branch. A waterfall loop that gives each lane the value of the lane it names becomes a single group gather through the compute swizzle exchange.row_shradds,v_permlanex16, upper-row add) becomesWavePrefixSum. A select-then-copy into the accumulator is first merged into one select.s_cselect/s_addc/s_subbare accepted when SCC came from plain data.|andj = j | (c). The resolve kernels' unoptimised DXIL has a third fewer blocks, and DXC optimises them in 45 s instead of 83–110 s.t1, space32766in the root, heap-loaded buffer descriptors get word 1 (the stride) from the runtime, so heap-indexed IDXEN accesses translate.Runtime (
d3d12,dxbc)clzeroloops. On hosts without CLZERO, every call used to trap five times, about four million exceptions in half an hour.Both title patches write nothing unless the code matches 1.0.2.1 byte for byte.
TUXBOX_KEEP_TITLE_WATCHDOG=1keeps the watchdog.Launcher
VKD3D_SHADER_DEBUG=err, so DXIL conversion failures name the construct the shader compiler rejected.Host-profile record
host_profiles.txtchanges for thesaveexecandemptyprograms on every profile. Their jump-flag guards are now joined with|(commit "or jump flags together in compute programs"). Nothing else in the record changes.Verified on Lanes
A pull request is not merged until Lanes passes on a GPU. Run:
python tuxbox.py checkpassed on this branch: every stage that ran passed, including Lanes and the fixtures on the GPU. The D3D12 regression controls and the translator GPU checks did not run, because they need--proton,--prefixand--windows-dxc.check_translator_gpu.py.GPU, driver and backend: NVIDIA RTX 3000 Ada Generation Laptop GPU (10de:2838, host profile wave 32-32), driver 620.73.04, Proton backend with GE-Proton11-14 (vkd3d-proton v3.1-83-gcae8353ed), Linux 7.3.5.
Paste the summary printed at the end:
ProjectScarlett 1.0.2.1 with this build at its start menu, from the game log:
Checks
CI runs the Python unit tests, the shader compiler, DXBC, and XG layout tests, and a Windows typecheck of
tuxbox-d3d12.These ran locally on the rebased tip, as in CI:
python -m unittest discover -s tests -qcargo test … tools/shader-compilercargo test -p tuxbox-dxbc --features native-bindingscargo test -p tuxbox-xg-layoutcargo check --target x86_64-pc-windows-msvc -p tuxbox-d3d12--tests, here and at every runtime commit before the rebaseNo evidence JSON changes.
🤖 Generated with Claude Code
A buffer descriptor loaded from the resource heap and then read with IDXEN needs its element stride, which the console keeps in bits 16..29 of V# word 1. Translated programs never see the console V#, so these were refused ("raw buffer IDXEN needs the console descriptor stride"). When the root carries the runtime's stride table (root SRV t1, space32766, one u32 per guest heap slot), a heap descriptor load fills word 1 from it, and IDXEN on that descriptor decodes the stride from there. Without the table nothing changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>@bbijsterbosch on GitHub · 2026-11-26 09:06 UTC · original
Please note performance of shader compilation is very poor. will optimize after ive resolved more unsupported shaders.
@NickStallman on GitHub · 2026-11-26 09:26 UTC · original
AMD run of
python tuxbox.py checkon this PR's head (7e0ad65):guest-present,guest-present-rgb10,guest-present-4k-owned,guest-present-4k-oversizedandguest-present-4k-fit.mainand on every other branch I've run on this machine. They come from how this host samples the screen, so they aren't caused by this change.@bbijsterbosch on GitHub · 2026-11-26 09:55 UTC · original · edited 2026-11-26 10:11 UTC
@NickStallman you manage to get past the loading screen?
edit: read your pr nice work!
@NickStallman on GitHub · 2026-11-26 10:24 UTC · original
@bbijsterbosch Thanks! Partly. I ran this PR plus #217 on
main773278a, on an RTX 5090 (595.99.02, GE-Proton11-14). ProjectScarlett gets through the front end and the story loading screens and reachesGame Running(mission 0x98c85f2a, SRLfbk_stry000_FBK_STRY000_INTRO). Then, in both runs, the GPU was lost atPrestream Metadata, before the intro starts:NVRM: Xid 13 … SKEDCHECK36_DEPENDENCE_COUNTER_UNDERFLOW, then vkd3d-protonVK_ERROR_DEVICE_LOST, about 22 min in.NVRM: Xid 109 … CTX SWITCH TIMEOUT, thenVK_ERROR_DEVICE_LOST, about 19 min in.VKD3D_CONFIG=breadcrumbswas set but printed no dump.+0x23CF683(#215), because the render thread spins on a label the lost device never writes.mainwithout this PR: four runs on the same machine never lost the device. They reached the same point and died of label-wait stalls instead (#215).CS=b51813bc…,5aafeb77…), and the second loss is a hang. So the new loop and long-jump lowerings might be worth checking for a loop that never exits on the GPU.I can rerun with any diagnostics you'd like.
@JeffreyBytes on GitHub · 2026-11-26 11:10 UTC · original
AMD run of ProjectScarlett 1.0.2.1 on this PR's head (
7e0ad65), compared withmain(773278a).RX 6700 XT (
1002:73df), Mesa RADV 26.3.1, Linux 7.3.6, GE-Proton11-14, i5-12600K. Both sides ran with theANONONLYpreload from #191 (host profilesection-import=aliased), because without it this card only gets the 1 fps copy path.Shader preparation
mainThree launches in a row on this PR, from the Account Picker to the story loading screen:
main(warm)0x80070057,0x80004001,0x80004005)So on this card the PR halves the compute shaders that have no translation (293 to 136) and more than halves the driver compile failures. The deadline stand-ins are a one-launch effect: on launch 2, the first with nothing left to translate, 448 compute pipelines missed the driver compile deadline; on launch 3 the driver cache had them and none did.
The log has
replaced clzero loops at RVA 0x4e8aa10 with AVX stores (host lacks CLZERO),pausing the title's hang watchdog (RVA 0x71b6330) while shaders compileandtranslated a compute shader with the heap stride table. No stand-in was bound at the picker (null usage … compute=0 raster=0), same as the NVIDIA result.How each launch ended. Two to three minutes after leaving the picker the device was lost and the title exited with code 5. This is the page-remap device loss from #191 (
radv/amdgpu: The CS has been rejected (-14)after oneCopyPageMappingsBatchXbatch). It happens at the same point onmain, so it is not caused by this PR, but it means I can't see past the story loading screen on AMD yet.Not run:
python tuxbox.py check. On this machine its translator stage currently fails onmainfor an unrelated reason (#219).@gtb-sbe on GitHub · 2026-11-26 13:25 UTC · original
One more AMD data point, this time RDNA4 and after the merge, without the preload.
Host: RX 9060 XT (
1002:7590), Mesa 26.2.6 RADV, Linux 6.18, GE-Proton11-14,mainat9b31fd8. Host profilewave=32-64 section-import=substituted descriptor-bytes=32/16, so the #200 copy path.tuxbox.py checkwith--backend proton --proton ... --windows-dxc ...: everything passes, including the fiveguest-present*gates, all 19 regression controls (buffer-remapand the newbuffer-unmap-*too) and the translator checks.ProjectScarlett 1.0.2.1, offline, cold translation cache, the same machine before and after this PR:
maincb8c38bmain9b31fd8rank_pipeline_failures.py)vkd3d result -3, all afterdxil-spirv: Failed to remap ...32765:0lit=0.998The sampler remaps are what #227 covers; I can run those branches here once they're up. The rest of the 108 are SRV and CBV remaps (SRV
0:12617,1:639,0:78,1:2396, CBV1:04, ...), about 56 on compute and 52 on raster.On the compute side, every remaining rejection used the plain translation of the program (
CS.usedequals the source digest in the failure record). In 24 of them the root-keyed lookup is recorded asmissingfirst, so the provider fell back to the root-less translation (.or_else(|| prepared(bytes))in the reflected arm,prepared(bytes).or_else(...)in the last arm). Doesmissingthere mean the translator refused the program for this root, or that its translation wasn't ready yet? If it was a refusal, recording that reason instead of trying the root-less variant would end in the same stand-in but name the real cause. I have the captured roots for these and can look into it if that's useful.Failed to remapin ProjectScarlett: which bindings cause them (RX 9060 XT) #233