A failed section heap is fatal in d73f11d/4b52fcd: a 12 GB card dies at boot (0xE0434352) where 68b6d06 survived and reached the story load #13
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/ThatRecompDev--five-star-recomp#13
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?
@danik1222 on GitHub · 2026-11-24 21:04 UTC · original
On a 12 GB card the game's 6.2 GiB section cannot be backed on the GPU.
68b6d06survived that and reached the story load; every build since (d73f11d,4b52fcd) dies at boot instead, right after the first failed section heap.Tested on one machine, not the reference one:
7952987ACommand (loader options after
--):What works here (all of this on
68b6d06)Microsoft.GDK.Windows2610 (416 named thunks).bcpack-tables.bin(the 77,982-byte file from VIctory's repository) fonts and texturesdecode exactly: the UI text is complete (Spanish), the artwork is full colour, 4K frames.
shader-translate, the driver cache builds up over boots.The blocker: a failed section heap is fatal in the newer builds
On this card
OpenExistingHeapFromAddressfails for part of the game's 6.2 GiB section(
XMemVirtualAlloc(0x185c00000)), because ~5 GiB of heaps is all that fits next to the title's 4Ktargets and textures:
68b6d06: logs that and keeps running. The boot then lasts minutes and reaches the storyload, where the game faults with
0xc0000005 access violation, write to 0x0— plausibly reading0 from the unmapped window.
d73f11dand4b52fcd: the same failure is fatal at boot:0 presents, exit0xE0434352, in every configuration tried:pipeline-cache/pipelines-used.binproduced here, and with it removed,program-cachefrom68b6d06, and with it removed,--trace-pool-stores,--retire-waits-all-queues.An
AppDomain.UnhandledExceptionhandler inProgram.Maindoes not fire, so it is not a plainunhandled exception on the main thread; WER shows only
KERNELBASE+0xc569a, and there is no.NET Runtimeevent in the Application log.So the new address map (the log line
address map: 0x20a0000 bytes for 64 spans, views from desktop index 10, 1 ranges waiting) appears to treat the failed heap as fatal, where the old code read zerosand continued. On a 24 GB card that failure never happens, which is why it is invisible on the
reference machines.
Window-size and profile tests (12 GB card)
SectionHeaps.WindowBytes1 GiB → 256 MiB0x8007000e; the limit is cumulative (~5 GiB), not per-allocation--device-type 6(Series S)--retire-waits-all-queuesCLWBto NOPs (--patches)0x80000003at 8 presents, or0xc0000005with 0)Secondary: intermittent
0xC000001Dat aCLWBsite (Intel Haswell)Exit
0xC000001D(-1073741795), unrelated to the heap: sometimes after 8 presents, sometimes after4.200. A WER dump gives:
Bytes at that RVA (
.text, RVA 0x1000 / raw 0x400):The handler emulated
CLWBat+0x4e4b680earlier in the same log, so the same kind of fault ishandled at one site and not at another. Forcing
LineLoop.TrySkipto return 0 (no cache-line loopfast-forward) does not change it.
Ask
68b6d06fell back to zeros; if the new address mapdid the same, a 12 GB card would reach the story load (and the rest of the run would at least be
measurable).
6.2 GiB but the frames we see touch far less; on a 12 GB card that difference decides whether the
load completes.
CLWBREX.B form supposed to be emulated? It is emulated once and then faults at thesame RIP later in the same boot.
Patches/logs available on request: the two logs (
68b6d06and4b52fcd), the WER dump (trimmed) andthe exact command line. I can also run any diagnostic build (
--memory-map,--watch-transient,--trace-pool-stores) on this card and report back — that is the one thing the reference machinecannot reproduce.
@danik1222 on GitHub · 2026-11-24 21:04 UTC · original
Excerpts from the two logs on the 12 GB card. Both are from the same machine, same dump, same command line; only the build differs.
68b6d06— the failure is tolerated, the boot runs to the story load4b52fcd— the same failure, then the process ends at bootthen nothing:
fivestar-loader exit code -532462766(0xE0434352), 0 presents, 0 faults, 6 warnings.Both sections are ~6.2 GiB (
99776pages at the call above); in each case the heap that fails is thefifth or sixth 1 GiB window, i.e. once ~4–5 GiB of heaps is already resident on a 12 GB card.
The failure also reproduces with
--bcpack-tablesabsent (placeholder textures), so it is not thedecoded texture set that pushes it over: it is the section mapping itself.
@danik1222 on GitHub · 2026-11-24 21:39 UTC · original
Also reproduced on
9423dde(main as of 2026-11-24 22:38, i.e. after the lane-present letterboxed scaling and the lane-perf texture-upload changes), same machine, same command line:The log again ends right after the failed section heap:
68b6d06on the same card still boots and reaches the story load, so the difference is still the newer address map treating a failed heap as fatal. Retested with the program cache and the pipeline journal removed as well: same result.@danik1222 on GitHub · 2026-11-24 21:40 UTC · original
Two notes from the machine in this report (i7-4770, RTX 3060 12 GB):
#14 is about this machine. The "5 to 8 fps on a 4-core i7-4770" in that PR is this run: 600→4.200 presents at 73–200 ms per frame while the driver compiles. Once a build boots here again (see the section heap below), I can run the A/B that PR asks for --
--normal-priority-buildson and off, same dump, same input script, with--capture-presentsfor the frame times -- and post the numbers. That is a 4-core, not a 12-thread, data point.Still the blocker on this card: main
9423ddeand4b52fcdboth die at boot with0xE0434352and 0 presents, right afterOpenExistingHeapFromAddressfails for a window of the 6.2 GiB section;68b6d06logs the same failure and keeps going to the story load. So any A/B has to wait for a build where a failed section heap is not fatal -- or for a way to make it not fail on 12 GB (lazy per-page backing).@marquezinii on GitHub · 2026-11-24 21:49 UTC · original
I looked at the crash on the 12 GB card and wrote a fix: #15. Summary:
Why the newer builds end at boot.
GpuTextureUploadercreates its upload buffer through Vortice, and Vortice throws when the creation fails. The upload buffer is system memory, and the section heaps had already used up that budget (the same0x8007000eas the failed windows). So the first texture filled from memory threwE_OUTOFMEMORYon the game's thread, and the process ended with 0xE0434352. That is why nothing was logged and yourUnhandledExceptionhandler never ran. With #15, that fill fails, is logged and counted (UploadFailed), and the boot goes on.What runs out is RAM, not VRAM. Heaps from
OpenExistingHeapFromAddressare system memory and count against the adapter's non-local segment, whose budget is half of physical memory. On my machine (RTX 5070, also 12 GB, 32 GB of RAM)QueryVideoMemoryInforeports a local budget of 11.7 GB and a non-local budget of 16.3 GB. With 15.6 GB of RAM you get about 7.8 GB. The 6.2 GiB section's windows, plus the upload ring and the other system-memory buffers, go past that around the fifth window, which matches your logs. A 3060 in a 32 GB machine would most likely open every window.Why
68b6d06got further. The address map that follows remaps (#8, mine) gives every mapped XMem page a view of its section. It does that when the map starts and at every remap, so the whole 6.2 GiB section is opened as heaps at boot. Before that, only slot-133 buffer runs opened windows, and only when the game placed one there. So #8 raised the non-local use, and on a 16 GB machine that is where the budget runs out.What #15 does not fix. Pages in a window whose heap failed still read as zeros on the GPU. That is probably what led to the
write to 0x0fault at the story load on68b6d06, and a 16 GB machine will likely reach it again. Possible directions; the choice is the maintainer's:MakeResident/Evict), so the 6.2 GiB do not all stay resident at once;@danik1222, could you run #15 (branch
loader/texture-upload-oomon marquezinii/five-star-recomp) on the 3060 machine and post how far it gets, and whether the log showsnot filled from memorylines? I can't reproduce it here: with 32 GB the budget is 16 GB.@danik1222 on GitHub · 2026-11-24 21:53 UTC · original
**#15 tested on the 3060 machine** (branch
loader/texture-upload-oomata654736, built here; same dump, same command line,--bcpack-tables+--shader-jobs 2).Good news first: the
0xE0434352crash is gone. The boot no longer dies with 0 presents on a managed exception.What the log shows now (exactly the lines you asked about):
Then the boot stops on the game's own breakpoint:
So:
UploadFailedworks, the run survives the fill failures, and the next wall is aint3in the game right after (the last traced calls arexg_xs.dll!XGCreateTextureComputer/XGSuggestSwizzleMode). My guess is the game asserts because the textures it asked for are not there -- but you will know better than me.This also confirms your budget arithmetic: with 15.6 GB of RAM the section heaps run out at the fifth window, and the upload ring goes with them. If you want a data point from a 32 GB machine I cannot give it -- this one is 15.6 GB. But I can run anything you want on it: a diagnostic build that logs
QueryVideoMemoryInfoat startup (as you suggested),--eager-pipelinesoff/on, or #14's--normal-priority-buildsA/B once a build gets past this int3.@marquezinii on GitHub · 2026-11-24 21:55 UTC · original
Thanks for testing so fast. So the managed exception was the first wall, and #15 gets past it.
About the
int3: I think the cause is the same budget running out, not the textures. With the non-local segment full, the command-list upload ring can't get its buffer either (list slot 148: no upload buffer; allocations return null). After that, everyAllocateUploadMemoryreturns null to the game, and a null there is something the game would assert on. The XG calls are probably just the last ones traced before it. To confirm:list slot 148warning in the log, and roughly where relative to theint3?FAULT #1(the RVA ingame_scarlett_master.exe), and the ~20 log lines before it.If it is the upload ring, more fallbacks won't help. The section heaps have to take less of the non-local budget on a 16 GB machine, i.e. open windows lazily instead of one heap per mapped page at boot. That is follow-up work on the address map from #8. I'll raise it with the maintainer rather than start it unasked, since it touches their memory model.
The
--normal-priority-buildsA/B from #14 is on hold until the maintainer's compile-host change lands. #14 will then be narrowed to the pipeline build threads.@danik1222 on GitHub · 2026-11-24 21:57 UTC · original
Answers to both questions, from
run-20261124-225153.log(builda654736).1. No
list slot 148warning at all (0 matches forslot 148,upload bufferorAllocateUpload). What is there, in the last 25 lines before theint3, is a failed command-list close, and the boxed HRESULT is the same budget:2. The faulting address and the assertion. It is
game_scarlett_master.exe RVA 0x72ac, inside the function at RVA0x7270..0x7323(+0x3c):So it is the game's own
int3assertion, andraxstill holds0x8007000ewhen it fires -- the E_OUTOFMEMORY from the failed allocation is what it asserts on. That fits your reading: the ring/budget runs out, an allocation returns the failure, the game checks it and breaks. Thexg_xscalls after that are just the last traced ones.Your summary matches what we see: #15 turns the process-ending managed exception into 22 counted
UploadFailedand a logged close failure, and the next wall is the game's assertion on that HRESULT. I agree that more fallbacks do not help -- the section heaps have to give the non-local budget back, i.e. lazy windows in the #8 address map. Happy to test that when it exists, and to runQueryVideoMemoryInfologging on this machine in the meantime if it helps you size the budget (15.6 GB RAM here).@danik1222 on GitHub · 2026-11-24 22:09 UTC · original
One negative result, so nobody spends time on it: trimming the working set does not change the budget.
I ran #15 with a helper that called
EmptyWorkingSeton the loader every 2 s (forcing pages to the pagefile, freeing physical RAM), to test whether the non-local budget follows free memory rather than RAM/2. Identical numbers with and without it:not filled from memorycommand list Close failed: 0x8007000eSo the budget is fixed (half of physical RAM), not a function of free memory -- freeing 2-3 GB of working set opens no extra window. That rules out the "make room by paging" direction on a 16 GB machine; only taking less of the budget (lazy windows) or more RAM will do it.
I am back on
68b6d06here in the meantime, since it boots and reaches the story load.@danik1222 on GitHub · 2026-11-24 22:14 UTC · original
Tested main 2e637d (the merge of #15) on the 3060 / 15.6 GB machine, same command line:
Same counts as the branch build: 3 failed section heaps, 8
ot filled from memory, 0 presents.
So #15 did its job (no more ␀xE0434352; the failures are logged and counted) and the next wall is exactly what you predicted: the non-local budget is gone before the game finishes booting, an allocation returns ␀x8007000e, and the game asserts on it.
That makes the address-map change the only thing between this machine and a boot: open windows when the GPU first uses them instead of one heap per mapped page at startup (#8). Happy to test any branch that does it, and to post the numbers for it on a 16 GB machine -- which is the case you cannot reproduce.
@ThatRecompDev on GitHub · 2026-11-24 22:34 UTC · original
lazy windows are in main now (
880e616), which is pretty much what you two worked out here. the loader reads the non-local budget from DXGI and only opens section heaps while they fit, with some headroom left for upload buffers and the command lists. a section that doesn't fit gets backed in 64 MiB windows when it's first used. we simulated your machine with--section-heap-budget 5and it got past the first-run screens to the story loadalso fixed the CLWB crash, that was a race when bink installs its exception handler at every video
@danik1222 could you give
880e616a go on the 3060? the useful lines are "GPU memory", "does not fit" and "no heap at". if it still dies at the story load, the RVA would help: we get an AV at 0x540abf5 there on our own machine too, so that one probably isn't you@danik1222 on GitHub · 2026-11-24 22:45 UTC · original
880e616tested on the 3060 / 15.6 GB machine. Big step: it boots and runs -- 9.000 presents, 0 faults, ~80 ms per frame, no0xE0434352, no failed heap (the CLWB fix holds too, 5 emulated CLWB, no0xC000001D).But the screen is entirely black, and I think the budget lines explain why:
So the section is backed lazily as designed, but on this machine it only gets 2328 MiB of room, not the ~5 GiB you simulated with
--section-heap-budget 5.systemis already at 2.66 of 6.68 GiB when the map starts (textures:Upload 28616, plus the ring and the map's own buffers), which leaves the smaller room.Evidence that nothing is drawn: every captured frame is 0 of 8,294,400 pixels not black (mean rgb 0,0,0), at present 1200, 2400, 3600 and 4800, while the game keeps presenting and taking Space taps.
No
no heap atlines at all, and nonot filled from memoryeither -- the windows that open are fine; it looks like the UI data lives past the 2328 MiB that fit.Questions:
GPU memoryline only prints at startup and when the map starts.)View 12,148,741views created this boot looks enormous) -- so the section gets more room?--section-heap-budgetusable on a real run to force a bigger room than DXGI reports, or is it only for simulation? If it can only lower it, we are stuck with 2328 MiB on 15.6 GB of RAM.If it dies at the story load I will send the RVA as you asked; this boot did not fault at all, it just draws nothing.
@danik1222 on GitHub · 2026-11-24 22:48 UTC · original
One more data point from that same
880e616boot, and it is a good one: the opening cutscene starts here. I stopped the run by hand, but before that:So the story load completes on a 15.6 GB machine with lazy windows -- it gets to the cutscene, and the audio of it plays (I could hear it). What is missing is only the picture: black, 0 of 8.294.400 pixels.
The two lines that go with it:
So the remaining gap is the room, not a fault: 2328 MiB of room for a 6272 MiB section, and the parts the cutscene draws from never get a heap. If the room calculation left more of the 6.68 GiB for the section (or the section's windows were allowed past the headroom), this machine would very likely show the cutscene.
For reference, this boot had no faults at all, 0 failed heaps, 0
not filled from memory, and presented ~12 fps the whole time.@danik1222 on GitHub · 2026-11-24 23:05 UTC · original
Negative result that narrows it down: more room is not enough.
I lowered Headroom (768 -> 256 MiB) and PlacedReserve (1 GiB -> 256 MiB) locally on
880e616to see whether the picture came back with a bigger window room:So +1280 MiB of room changed nothing visually, and taking it from the headroom broke the upload ring (command list Close failed). The cutscene is drawing from parts of the section far past 3.6 GiB, and on this machine the whole 6272 MiB will not fit in a 6.68 GiB budget that already has 2.66 GiB in use.
That leaves two designs that would work on 15.6 GB of RAM, both yours to choose:
I reverted my local constants and I am back on
880e616unmodified, so nothing I report comes from a patched build except the numbers above.@marquezinii on GitHub · 2026-11-24 23:19 UTC · original
Some answers from the code on main (
323ea30), for the questions that don't need a design decision:Where the 2.66 GiB of
systemwent before the map started. Most of it is probably the game's own 2.2 GiB heap.XboxGameMemoryBuffershandles the first GPU address that misses the placed buffers by opening the wholeVirtualAllocallocation around it as one heap (OpenExistingHeapFromAddress) and covering it with one buffer. The game's committed heap (2.2 GiB,PAGE_GRAPHICS_READWRITE) is that kind of allocation. It counts against the same non-local budget as the section windows, and it is opened whole, not in windows. The upload ring is 32 MiB, and the texture uploader keeps one staging buffer the size of the largest texture, so neither comes close.Q2,
View 12,148,741. That counter counts slot-70 calls, not live descriptors. The views are written into the game's own descriptor heaps, so the number says nothing about memory. Fewer texture uploads would not help either: each upload reuses the one staging buffer.Q3,
--section-heap-budget. It can only lower the room.SectionHeaps.Roomismin(Cap - opened, system budget - use - headroom), so it can simulate a smaller machine but not give yours more.That adds up with your last result: 6.1 GiB of section plus 2.2 GiB of game heap is already more than the 6.68 GiB budget before anything else, so no choice of headroom shows the cutscene on 15.6 GB. Either windows have to stop being resident all at once (your option 1, which would also apply to the game heap if it were windowed), or 16 GB stays a "boots, plays audio, draws nothing" case for now. That choice is the maintainer's.
@danik1222 on GitHub · 2026-11-24 23:53 UTC · original
One number that updates the premise of #14, from the same i7-4770 / 3060 / 15.6 GB machine, on main
98426b0(the compile cap and ceiling):Before tonight's compile changes the same machine ran at 73-200 ms per frame, so 35-39 ms is a 4-5x improvement on 4 cores -- #14's "5 to 8 fps on a 4-core i7-4770" is no longer the state of this machine. (The screen is still black: the
2328 MiB of section-heap roomfor a6272 MiBsection is unchanged, and every captured frame is 0 of 8,294,400 pixels.)So from this side: performance, stability and the CLWB crash are all fine now; the only open item is the section/game-heap residency, as you explained in #14. I will stay quiet here unless you want another run.
@ThatRecompDev on GitHub · 2026-11-25 08:10 UTC · original
hey @danik1222, thanks for all the runs last night, the numbers really helped.
there's a new experimental flag on main,
--evict-windows. it's off by default, so you have to add it. what it does: the GPU tells the loader which parts of that 6.1 GiB section it actually reads, only those get opened, and the ones nobody has used for a while get released again. it also opens the game's 2.2 GiB heap in 64 MiB pieces instead of all at once, so that heap only takes budget where it's used. idea is the whole thing doesn't have to fit in your 6.68 GiB at the same time.one heads up: with the flag on, shaders get their own cache, so the first boot recompiles everything and will be slow. a second boot should be back to normal speed.
could you give latest main a go on the 3060 with
--evict-windowsadded to your usual command line? the useful bits from the log:section windows: N asked for, N opened for them, N releasedpart of the[sample]lines (the last one is enough)game memory 0x... (0x4000000 bytes of the allocation at ...)lines, or ano ID3D12Device13warning if your driver doesn't have itdevice removed/0x887a0005, plus the ~30 lines before itone thing we found overnight: when we squeeze the section heaps on our machine to even less room than yours, the cutscene still draws. so the black screen might not be the section heaps at all, and could be the whole system budget being nearly full. if it's still black with the flag, a run of plain main next to it (same command line) would help us tell the two apart.
placed textures are now on by default too, which fixed a set of device losses on our side, so the latest main is worth a try even without the flag
@danik1222 on GitHub · 2026-11-25 09:27 UTC · original
19134c8+ --evict-windows on the 3060 / 15.6 GB machine: the cutscene shows. 41,400 presents, ~35-101 ms.You were right about the flag being a first-boot cost. Two runs, same command line:
First boot (cold cache, as you warned). 19,800 presents, every capture black, section windows: 0 asked for, 0 opened for them, 0 released, 85,122 stand-ins, 2.1 M draws skipped. Nothing to draw with yet, so that run says nothing.
Second boot (warm cache). 41,400 presents, 35.11 ms mean over the last 600, and the frames are real:
1800 is Jason leaning on the car (Leonida tank top), 3600 is Lucia at the storefront with the bag, both letterboxed as your new present scaling intends. I can attach PNGs if you want them.
The numbers you asked for:
o ID3D12Device13, no device removed, no ␀x887a0005 in either run.
Plain main, same command line, no flag: 10,800 presents, every capture black, same ␀xc0000005 write to 0x0 at the end. So on this machine the difference between black and the cutscene is --evict-windows (and the second boot).
Great work -- this is the first time this machine has shown anything but black.
@ThatRecompDev on GitHub · 2026-11-25 09:35 UTC · original
that's great to see, thanks for running both boots and for the careful numbers. first time a 16 GB machine shows the cutscene, nice
the
0 asked forpart is interesting. it means the picture came from the game heap being opened in 64 MiB pieces, and the GPU feedback path for the section never triggered. we'll look into why, since on a section-heavy budget that's the part that should matterfor the write to 0x0 at the end: could you send the FAULT block (the RVA and the stack lines under it) plus the ~30 log lines before it? we see a similar late fault on our side and want to know if it's the same one
also worth knowing, main moved a lot since
19134c8: all of the game's shaders translate now (176 deferred-pass ones were failing before), the mesh shaders are a lot cheaper to compile, and compiled shaders are now cached by content, so translator updates don't throw your whole cache away anymore. a run on latest main with--evict-windowswould be a good comparison when you have time. and yes, PNGs would be very welcome@danik1222 on GitHub · 2026-11-25 09:49 UTC · original
Here is the FAULT block from the warm boot (
un-20261125-094537.log, fault at ~30 min, after the cutscene had been drawing):
The instruction at RVA 0x23cf683 is
C7 04 25 00000000 21D48B-- an absolute store to address 0 (mov dword ptr [0], 0x8bd421), so the game writes to a null pointer it computed, rather than dereferencing one it read.The lines immediately before it (the
[sample]block above is my own--sample-threads 60thread dump, nothing D3D in it):So no failed allocation, no device removed and no
0x887a0005before it -- it is a plain null write after a run of texture uploads.On the 16 GB / cold vs warm difference: agreed, and my guess is the same as yours -- the game heap opened in 64 MiB pieces is what gave the section enough room to show the picture. The GPU feedback never fired (
0 asked for), so that path is untested on this machine.On the PNGs: they are on this machine and I can send them (Discord is easiest), but I would rather not put game frames in the repository or a fork given the no-game-content rule. Say where you want them and they are yours.
On latest main: building it now and will run it with
--evict-windows(two boots again if the cache is cold), then post the same set of numbers for comparison.@danik1222 on GitHub · 2026-11-25 10:14 UTC · original
Latest main
36385c5+ --evict-windows, same machine, two boots:First boot (cold): ␀xE0434352 at 3.000 presents, ~2.5 min. No stack in the log. The
[sample]line just before it says where the time is going:Second boot (warm): it draws, but the picture is frozen on one shot. 16.800 presents, 43.22 ms mean:
All four are the same Lucia frame (the mean barely moves over 5.400 presents, ~4 min). With
19134c8the four captures were four different shots (Jason, Lucia, and two dark ones), so the cutscene advanced there and here it does not. My guess: the queue (3.973 queued, 2 waiting for memory, 5.3 M draws skipped, 764 over the first-use budget) keeps the next shot's pipelines as stand-ins, so the presenter keeps the last good frame. But you will know if that is expected.Other numbers from the warm boot:
section windows: 0 asked for, 0 opened for them, 0 releasedagain, game memory ... (0x4000000 bytes ...) lines present, no device removed, and the same late fault as before: ␀xc0000005 access violation, write to 0x0, this time after 762 s.So on this machine:
19134c8= cutscene advancing;36385c5= black on a cold boot, one frozen shot on a warm boot. If it helps, I can bisect between them (the two are ~40 commits apart) and tell you the first one that keeps the cutscene moving.@ThatRecompDev on GitHub · 2026-11-25 10:28 UTC · original
https://discord.gg/FpRTMVa (1hour)
@danik1222 on GitHub · 2026-11-25 11:17 UTC · original
Both commits work on the 15.6 GB machine.
2ec2ec3+ --evict-windows:And the cutscene moves again -- the five captures are different shots:
So the frozen frame is gone: the feedback path fires (521 asked), windows open and are released (66 opened, 48 released), and the compile floor at RAM/8 lets programs be made (1.145 instead of 10). 9.001 presents, ~960 s, then the same late fault.
The late fault is unchanged -- and this time Windows showed it as the usual dialog, which confirms the address: "The instruction at 0x00000001423CF683 made a reference to memory at 0x0000000000000000. The memory could not be written." So it is exactly the ␀x23cf683 / mov dword ptr [0], ... block above, every run.
No unhandled-exception stack was needed this time: the cold boot of
2ec2ec3started fine, so whatever was throwing in36385c5is gone (or the new floor avoids it).From this machine: the low-RAM path is doing what you designed it to do. Only the null write at 0x23cf683 is left.
@danik1222 on GitHub · 2026-11-25 11:20 UTC · original
Thanks for the Discord invite -- I will pass on it: I do not use Discord, and everything I have is already in this thread, in English, which is fine for me. If there is anything you want from the machine, ask here and it will be in the next comment.
On the PNGs: I can send them if you name a place that is not the repository (they are game frames, so they do not belong there under your no-game-content rule). Otherwise the capture lines above are the whole story: four different shots, and a near-black one at present 9000 that looks like a fade or a subtitle.
@danik1222 on GitHub · 2026-11-25 11:29 UTC · original
Two frames from the
19134c8warm boot, on a temporary host (they expire in 72 h and are not mirrored anywhere, so nothing of the game stays online):Both are 3840x2160 with the letterbox your new present scaling adds, straight from --capture-presents. The frames from
2ec2ec3(the moving cutscene) I have not uploaded; say the word and they go to the same temporary host for 72 h.The null write at ␀x23cf683 is the only thing left from this side. It happens at ~960 s on
2ec2ec3, after the cutscene has been playing, and Windows shows it as "The instruction at 0x00000001423CF683 made a reference to memory at 0x0000000000000000. The memory could not be written."@ThatRecompDev on GitHub · 2026-11-25 11:42 UTC · original
great to hear the cutscene moves now, thanks for testing all of these!
that write at 0x23cf683 is the game's own hang watchdog: it crashes on purpose when a frame takes over 30 s, which happens when some GPU work runs for a very long time. we've been chasing exactly that today: a few mesh shaders loop on bad counts, and we've capped those loops so a runaway one now costs ~0.1-0.2 s instead of seconds (on main since
33b52d7). if you have time for one more run on current main,--watch-hang --d3d12-breadcrumbswould name the stuck pass in the log@ThatRecompDev on GitHub · 2026-11-25 11:44 UTC · original
one more thing we noticed looking at your runs again: your second (warm) boot starts with the save folder the first boot wrote (
%LOCALAPPDATA%\FiveStar\GdkData\<TitleId>), so the game skips the first-run screens and loads its autosaved checkpoint instead of playing the new-game intro. so those moving shots are the save-load path, not the opening intro we test on.both are useful, but they're different paths, so it'd help to know which one each run takes:
--input-script docs/first-run.inputto get through the screens).if you can, a pair of warm-cache runs, one of each, would tell us whether the late 0x23cf683 watchdog is specific to loading the save or happens on the intro too
@danik1222 on GitHub · 2026-11-25 12:31 UTC · original
The two paths are different, and --watch-hang names what stalls. Current main (
376adc4), same command line, --evict-windows --watch-hang --d3d12-breadcrumbs.A. Save-load path (GdkData present). 43.800 presents at 33.7 ms (30 fps), placed textures: 18.312 live in 24 heaps (6.0 GB used) -- then it stops on the game's own "NO SE HA PODIDO GUARDAR AUTOMÁTICAMENTE" dialog (Retry / Done). A and B taps do not dismiss it; I also reloaded the input script with only B and it stayed. No watchdog fault on this path: it just waits on that dialog.
B. Intro path (GdkData moved aside, first run). 17.400 presents; the four captures are all the same uniform frame, mean rgb (32, 32, 44) -- the story-load screen -- and then the watchdog fires. --watch-hang gives this:
Two things from that:
And one thread is stuck in a self-recursive chain while it happens:
So: on this machine the intro path never gets past the story load (uniform 32,32,44 for 7.200 presents), while the save-load path reaches gameplay at 30 fps and then blocks on a failed autosave. Tell me which of the two you want me to dig into, and I will keep the runs coming.
@ThatRecompDev on GitHub · 2026-11-25 12:45 UTC · original
thanks, both of these were really useful. what we found:
intro path (stuck at the story load). the "loader waits" numbers in that line were totals since boot over all threads, not what blocked this stall, so they made the loader look guilty when it probably isn't. fixed on main (
bba95b5): the stall line now first lists only the waits that grew since the heartbeat stopped. the thread in fn 0x43c040 is just the game's audio thread sleeping, so it's a red herring too. with handler 0x1423cf620 armed, the game is waiting for the loading screen's render thread, which in turn waits on the fiveSubrender:%02uworkers, so the stuck one is one of those.could you rerun the intro path on
bba95b5and paste the whole[hang]block at 15 s and 25 s? the Subrender and loading-render thread lines, any "waiting in ..." tags and the new "since the heartbeat last moved" part are what we need.save-load path (the autosave dialog). one of our save calls failed. most likely replacing the old save file while something else (Defender, an indexer, or our own read) still had it open. on
bba95b5save updates run one at a time, the replace is retried for a second, and a failure is logged as[gdk] XGameSave update "<name>" failed: .... if the dialog still shows up, grep the log forXGameSaveandmanaged async oparound it.@danik1222 on GitHub · 2026-11-25 12:53 UTC · original
Before the ba95b5 runs: the intro path on
376adc4ended in another ␀xC000001D, and the shape is the one you fixed for CLWB:␀x144E8AAB0 = RVA 0x4e8aab0, one of the CLZERO sites (cpu: emulating CLZERO at game_scarlett_master.exe+0x4e8aab0 appears earlier in the same log). So: Bink registers its handler, and the next AMD-only instruction faults without reaching the emulator -- the same race you fixed for the ␀x4ecc84a CLWB, now at a CLZERO. It happened after 22.800 presents (~18 min), so the handler was working for many faults before.
Also, the memory map at the end of that run looks worth a look on a 15.6 GB machine:
9.02 GB in 601 heaps at the end (2 hours in, but it had been running 18 min). If that is not expected, it may be the real cause of the tight system budget on this machine.
And the good news from the same run: your docs/first-run.input plus an F8 watcher goes through the screens here -- it learned subtitles, legal and legal-next ([input] script waits for screen X ... press F8 -> F8 sent) and got to 22.800 presents instead of stopping at legal. So the input side is fine; it is the CLZERO fault that ends it.
Next: ba95b5 intro path with --watch-hang, and I will paste the whole [hang] block at 15 s and 25 s (Subrender and loading-render lines, waiting in ..., and the new "since the heartbeat last moved" part), then the save-load run for the XGameSave update lines.
@danik1222 on GitHub · 2026-11-25 13:21 UTC · original
Intro path on
2735cb0(with ba95b5): 34.800 presents at 34 ms, and the story load never finishes.Eight captures, all the same uniform frame -- mean rgb (32, 32, 44), 8,270,851 of 8,294,400 pixels not black -- i.e. the story-load screen, for the whole ~23 minutes. Then the watchdog: ERROR FAULT #1 on thread 8136: 0xc0000005 access violation, write to 0x0.
Your new stall line does what you wanted: it says the loader is innocent now.
About the Subrender:%02u and loading-render lines: they are not in this log. Select-String 'Subrender|loading-render|waiting in' returns 0 matches; the game's threads come out unnamed, as addresses and stacks only. So here is the whole [hang] block with the game-stack groups (the full block is 63 lines; these are the 13 with game frames, deduplicated by stack):
If you can tell me which RVA is the loading-render thread (or how to make the loader print the game's own thread names), I will run it again and point straight at the five workers. Without the names, this is what the machine can give.
@ThatRecompDev on GitHub · 2026-11-25 14:03 UTC · original
thanks, both runs are super useful.
CLZERO at 0x4e8aab0: you're right, that's the same race as the CLWB one: Bink puts its exception handler in front of ours, and the next AMD-only instruction never reaches our emulator. we're fixing it for every emulated instruction this time, not just one site.
9 GB in 601 heaps: not expected, we're looking into which heaps those are and whether they keep growing.
story load that never finishes: the stall line confirms the loader is idle, so the game is waiting on itself. main now has #31 (
7d0393d): with--watch-hangthe hang block names the exact event or semaphore each blocked thread waits on and whether anything ever signaled it. one more intro-path run on7d0393dwith--watch-hang, pasting the[hang]block at 15 s and 25 s, should tell us what the story load is stuck on.@ThatRecompDev on GitHub · 2026-11-25 14:11 UTC · original
one more small ask for the 9 GB of heaps: if you still have that log, could you paste the
[memory] heaps:line and the "since the last map" lines from two maps a few minutes apart? that tells us whether it keeps growing or levels off. the next build will also name which heap (the game's, ours or a driver's) owns the segments.and the CLZERO fix is in: our emulator now has a backstop handler at the end of the chain, so an AMD-only instruction reaches it even when Bink's handler goes first. it lands on main shortly.
@danik1222 on GitHub · 2026-11-25 14:39 UTC · original
Intro path on
7d0393dwith --watch-hang: the hang block names the events. 25.200 presents, then the watchdog (␀xc0000005, thread 8136) at ~1400 s. Captures are the same uniform story-load frame, mean rgb (32, 32, 44).The stall line (note: this time the loader was in it, for 6.2 s of small compute pipeline):
And the new section, whole:
Three things stand out:
If the handle numbers are enough to map them back to the game's own waits, this should say which step of the load stalls. I can also run it again with a longer timeout if you want the block at 15 s and 25 s of a longer stall -- here the report came at a 5.2 s stall and the watchdog ended the run before a 15 s one.
@danik1222 on GitHub · 2026-11-25 15:40 UTC · original
**7e682b works: no ␀xC000001D in a 430 s run.** Intro path on
d7b8b13, --watch-hang --memory-map 300:The heap map (
d8e867a) in this run was clean -- no 601 heaps:So the 9.02 GB / 601 heaps from the 18-minute run is not there in this 7-minute one: it either grows with time (the long run reached it) or it came from the run that had the autosave dialog. The per-heap names are exactly what was needed to tell -- I will catch it on the next long run.
GPU memory at that moment (new line, useful on this machine):
8.92 of 11.03 GB local with the world still not drawing -- that is mostly the placed textures and the 4K targets. Worth knowing for the "will it fit" question later.
One small thing on the input side: with docs/first-run.input plus an F8 watcher the run now learns subtitles, legal and legal-next and goes on, so the screens are not the problem here either.
@ThatRecompDev on GitHub · 2026-11-25 15:49 UTC · original
thanks, this is really useful. two things came out of it.
the 6 s the loader was in: that was the first use of small compute pipelines making their shaders right on the game's thread. on a 16 GB box that gets slow. it now does that in the background and the game thread only waits its normal short budget, then moves on.
on the wait list: careful with the numbers, they're "how long ago" from the 616 s report. so "waits 604 s" means those threads went to sleep about 11 s into the run. most of them are just idle worker pools that have been parked since startup, not the story load giving up. the one that actually started during the stall is thread 6036 (0x2164, 60 s timeout), so that's the one to watch.
the bad news is the "from ;" part, it was supposed to show where each one was made, but the stack walk died in our own shim code. fixed now. the next --watch-hang run prints the game address for both the code that made each object and the code that's waiting on it, and 0x6bc gets named if it's a thread handle.
so yes, a longer run on current main (
b97be31) would be great, ideally with the full thread stacks from the hang block too (especially 6036 and 16380)@danik1222 on GitHub · 2026-11-25 16:21 UTC · original
Save-load path on
d7b8b13: the autosave dialog is gone, the story plays, and the game reaches the prologue. Same 15.6 GB machine.No
failedline and no "no se ha podido guardar" dialog this time -- your retry-once change did it.Then: 40.800 presents, 0 faults, no
0xC000001D, and the captures show the cutscene art (mean rgb 138-145, 107-112, 126-131) up to present 7200. After that the prologue loads: the screen shows "PRÓLOGO", the hint "Acércate a una compañera de celda para interactuar con ella" and "DESCARTAR", and an NPC talks with its audio. So the game is in the prologue, standing in the cell, and the 3D image is the only thing missing -- which matches your roadmap line exactly:The character pipelines are stand-ins, so the world does not draw; everything else (UI, audio, input, saves, 30 fps cadence) works. Frame times during the load: 118-168 ms.
Two notes:
So from this side: story load, cutscene, save/load and the prologue all work on 16 GB of RAM. What is left for the picture is the character/stand-in side.
@ThatRecompDev on GitHub · 2026-11-25 16:43 UTC · original
this is great news, thanks! the prologue loading with UI, audio and saves working is a big milestone on a 16 GB box.
the missing 3D is expected right now: those ped pipelines are still being built in the background. on current main (
a2ce328),fivestar run --warmonce (about an hour on 16 GB, Ctrl+C resumes) builds the pipelines earlier boots used, so the next run should draw a lot more. main also fixes a class of game crashes at world load: the game rebuilds addresses in its big memory reservations as "high dword | offset", so those now start on 4 GB boundaries like on the console.and yes, please keep an eye on that heap number past 20 min if you can
@danik1222 on GitHub · 2026-11-25 17:14 UTC · original
Answer to the heap question, and this run got further than any before.
1930d7b, intro path,--watch-hang --memory-map 120, 1.616 s (27 min), 36.600 presents, exit0xc0000005at RVA0x23cf683(your own 30 s watchdog again). Zero0xC000001D.1. The heaps: it keeps growing, and it is never 601 heaps
The new map ran every 2 minutes, 13 times. Extracted verbatim:
Two things that should settle it:
mallocof every CRT, your native memory), from 0.25 GB in 22 segments to 1.96 GB in 131 segments, and it levels off at ~1.96 GB in the last two maps.XMemVirtualAllocstays at 4.51 GB (9 regions) and heap at 1.96 GB. So the anonymous side is the one that grows with time. Earlier "9.02 GB in 601 heaps" came from a different build/run and does not reproduce here.GPU at the last map: local 10.63 GB of 11.08 GB, non-local 4.84 GB of 6.68 GB.
The stack walk fix works. First block of the run:
Maker address, maker thread, maker time and waiter stack, all game addresses now -- no more "not created through the shims".
2. New: the story load finished and the game reached the prologue credits
After the load, the frames keep coming (36.600 presents, 33-72 ms) and the screen is the opening title card -- "VICE CITY HACE DOS AÑOS" with the cast names -- then the window goes "(No responde)" and your watchdog takes it. So on this machine the intro path is no longer stuck at the blue story load: it gets to the credits and dies there, and there is no
[hang]block for that final stall (only the ones in the first 17 s, all idle pools).The credits text is the broken-glyph problem (letters half-missing), same as the legal screens.
Also, a note on the terms screen from
docs/first-run.input: on this build the literaltermssequence did not get past it. It needed the two check boxes marked and then the "Continuar" row; the first Space press had the focus on the copyright item, as your own comment says, and the Down presses moved the panel, not the focus. Hand-driven, it worked. Might be worth a longer look at that block for empty-save runs.Nothing else new: saves, cutscene and 30 fps cadence all still fine at this build.
@Solarthis on GitHub · 2026-11-25 20:35 UTC · original
a5e1f25's diagnosis holds on a completely different backend, which is the useful part of this: ours is Vulkan on Metal on Apple Silicon with unified memory, so the budget is not DXGI's non-local segment and there is no VRAM to run short of.
Here the game's 2.2 GiB graphics heap is a hard 2,199 MiB, and at the story load it is full enough that the allocator refuses a 2 MiB buffer inside it. That is past the 46 MiB request
a5e1f25shrinks, so the ceiling is reached rather than approached. Answering XG's size for single-sample render, depth and UAV targets frees 49 MiB of the same heap on this backend too: same mechanism, about 2.5% of the heap, and the difference between reaching the allocator's fatal path and not.It also backs marquezinii on which segment this comes out of. The heap is opened whole as one allocation and counts in full, so it is the binding constraint long before any section is in play.
The desktop size of a target is a heap-size bug wherever the heap lives, then, not a workaround for one card's compression metadata.
@ThatRecompDev on GitHub · 2026-11-25 20:40 UTC · original
thanks, that's a really useful cross-check. a completely different backend hitting the same 2,199 MiB ceiling settles it for us: the desktop size of a target eats into the game's own heap no matter where that heap lives, so answering XG's size is the right fix, not a workaround for one card.
good to know the 2 MiB refusal sits past the 46 MiB request too, so we're actually at the ceiling there, not just close to it.
if you see the allocator's fatal path again on the current main, the heap usage line from the sample log right before it would help us see what else is growing in there
@danik1222 on GitHub · 2026-11-25 22:31 UTC · original
The journal warm-up can stop for good:
0 running, 1 waitingwith the CPU idle. Seen twice, on two builds, on a 16 GB / 4-core box:In both cases the counter stays put to the second,
one heavyclimbs on every retry, and nothing is compiling. Memory is not the cause: the first case had 12.6 GB free when it froze.Both were
fivestar setup <dump> --work <dir> --only pipeline-warm --jobs 2, and both builds already containede67c453andcb20d98.What I think is happening (
CompileBudget.cs)Enteradmits a compile and records it with itsHeavyflag:Exitremoves an entry by estimate only:Two compiles with the same estimate are common (the estimates are coarse buckets), and the removed entry is not necessarily the one that exited. If the removed entry is a non-heavy one and a heavy entry is left behind,
HeavyReserved()keeps counting it:and
Reservationnever reaches zero — it holds at least a quarter of the estimate afterSettleSeconds— soHeavyRoomkeeps refusing every heavy compile:That matches the signature exactly:
driver compiles 0 running,1 waiting,one heavygrowing, no CPU.Exitalso takesshaderBytesfrom its caller and only touches the record list whenshaderBytes >= TinyShaderBytes; if any path calls it with a smaller value thanEntersaw, the entry and_runningLargeare left behind the same way.Suggested fix
Match the exiting entry by more than its estimate — record a token (or the shader bytes and the admission's timestamp) and remove exactly that one, e.g.:
or, if the list must stay ordered, remove by
EstimateandHeavyandStarted.It is worth doing even if the leak is elsewhere: a reservation that can only decay to a quarter of a multi-GB estimate is enough to refuse every later heavy compile on a 16 GB machine.
I left the setup at 2044/3880 and booted instead (the cache kept 5347 pipelines, so the boot works); if you want the log or a rerun with
--jobs 1to see whether it reproduces on a single thread, say so.@ThatRecompDev on GitHub · 2026-11-25 23:23 UTC · original
thanks, that's a real bug and a great write-up. Exit matching only by estimate meant two compiles with the same estimate could remove each other's entry, and the leftover reservation then blocked every heavy compile on a 16 GB box. that explains the stall at 2044/3880.
it's fixed on main now (
416fce1and the merge before it): Enter hands out a ticket, and Exit removes exactly that entry and undoes exactly what its Enter added, the large-compile count and the expected bytes included. whether a compile counts as large is decided once at Enter, so a different byte count at Exit can't leave anything behind.no need for the --jobs 1 rerun. if you rerun the setup on current main and it still stalls, the budget's refusal counts in the log would tell us which rule is holding it
@danik1222 on GitHub · 2026-11-25 23:28 UTC · original · edited 2026-11-25 23:37 UTC
That matches exactly what we saw: two compiles in the same estimate bucket removing each other's entry, and the leftover reservation refusing every heavy compile afterwards. Enter deciding "large" once and Exit undoing that same ticket is the right shape. Thanks for turning it around in under an hour.
One thing worth knowing from this side, because it shapes how we test: a change in
FiveStar.Shadersinvalidates the whole translation cache here.TranslationCache.Identityhashes the translator assembly, soc0355a72andc75f0bc5(both in main since) mean the 2,885 programs this box is translating right now become unusable the moment we build them. On this 16 GB / 4-core machineshader-translatereports 11 h 30 min on two jobs and about half that on four, so the redo is a few hours of the box's night either way, and a boot that has to translate on demand instead spends it in stand-ins (67k stand-ins, 2.5k programs queued, black screen).So the plan is: finish the translation on
7a8f7eb, test that boot, then move to current main and pay the translation once more. That also means we cannot test--mesh-launchtonight -- it is not in7a8f7eb.If a stall shows up again on current main I will send the budget's refusal counters, as you asked. And if batching translator changes into fewer merges is an option on your side, every 16 GB tester will feel it.
@ThatRecompDev on GitHub · 2026-11-25 23:36 UTC · original
that's a really useful point, and you're right, we've been merging translator changes several times a night without thinking about what that costs on a 16 GB / 4-core box. 5 hours per change is way too much.
two things on our side:
we'll batch translator changes. they'll land together instead of one by one, and i'll say in the commit when a merge changes translation output, so you can tell which builds are worth moving to.
we're also looking at both halves of the cost. 6 s per program is slow, so we're profiling the translator to find where that time goes. and we're making the translation cache key narrower, so a change that doesn't touch what a program translates to doesn't throw that program away.
finishing on
7a8f7ebfirst sounds right. --mesh-launch is opt-in and unmeasured anyway, so no rush there@danik1222 on GitHub · 2026-11-25 23:38 UTC · original
Batching and labelling the merges that change translation output would help a lot here. Naming the ones worth moving to is the part we cannot infer from the outside.
A number for the profiling, measured on this box (i7-4770, 4 cores, 15.6 GB): with two jobs, 140 programs took 85 minutes of wall clock, so about 36 s per program -- six times your 6 s. The first three were the outliers you already know (2:38, 7:08, 10:44 together), and after them the pace settled. Now running four jobs, which keeps all four cores busy instead of one dxc at a time.
A narrower cache key would be the biggest win of the three: on a machine where a full pass is a night's work, not throwing away a program because an unrelated part of the translator moved is what makes moving between builds practical at all.
@ThatRecompDev on GitHub · 2026-11-26 07:30 UTC · original
heads up, three translator batches landed overnight (
b4f4527,436ad7c,c8cfcb7), so your shader cache gets rebuilt in full on the next bootc8cfcb7also fixes the compile memory blowup from the middle batch (a few compute shaders needed 12-15 GB each), so build onc8cfcb7or later rather than436ad7csorry for the churn, the next ones should be further apart