007 First Light (PPSA11386): the terrain crash after Resume is a stale read of a GPU feedback buffer past the title's own wait limits #6172
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?
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-15T00:19:33Z.
Summary
During the level load after Resume the title reads back a 160x90 GPU feedback buffer (8 bytes per entry) to decide which texture pages to stream. Before reading it, it polls a GPU label for at most 2 s (sceKernelReadTsc against sceKernelGetTscFrequency) and skips the wait once the feedback job is two or more frames old. On our stack the GPU stops presenting for about 300 s at level entry while the entry pipelines are created (26-64 s with them cached), and every timed crash sits at the start of that gap: the title reads the buffer before the GPU wrote it, the stale bytes (the memory's previous occupant) become page-request keys, the lookup of a texture id that does not exist fails (or a quadtree descent runs past a texture's extent), and the process crashes with SIGSEGV in the title's streaming code. A local title patch that widens the 2 s limit and the two-frame threshold removes the crash (8 clean of 8). Unpatched, 10 of 24 unscaled runs on 2026-10-14 crashed.
Setup
Bring-up branch share/007-v5 at 65c5b68f3 (fork SleglJan/AnyPS5), not upstream/main, which stops before the first frame in this title. Switches on the run line that change behaviour: branch-only APS5_AHEAD_PIPELINES=2, APS5_PIPELINED_DRAWS=8, APS5_NO_IDLE_STORE=1, APS5_SPARSE_RUN_IMPORT=1, APS5_LOCAL_LARGE_CLASSES=1; upstream APS5_HOST_IMPORT_MIB=12288, APS5_RESOURCE_CACHE_ENTRIES=64, APS5_NO_DRAW_SRT_ENTRIES=1; plus tracing switches and a guest-fault dump spec. CachyOS, kernel 7.2.10, RTX 3080, NVIDIA 615.78.08 (runs before 2026-10-14 15:30: kernel 7.2.9, NVIDIA 615.71.09). Evening runs 1200 s (3600 s at scale 0.02), morning runs 1080-3600 s, from a gameplay save, driven by injected pad input. 0.12-0.44 FPS at the end of the runs (2-8 s per frame).
Evidence
Related upstream items (live search 2026-10-15 ~02:20 on upstream/main
ab9a47684)d9852df2aevery frame waits out a title's 1 s frame timeout: the same title-side pattern (a bounded wait on GPU completion), there probably tripped by late label visibility (the reporter's reading).f3ac61000(libkernel Time.cpp): it scales sceKernelGetProcessTime, sceKernelGetProcessTimeCounter and sceKernelReadTsc (and guest clock_gettime's monotonic clocks on Windows only; on Linux those read the host clock), sleeps stay real, injected pad input is timed in guest time. It is not in docs/.Proposal
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-16T17:56:29Z.
Windows007 level result on c6bd8b539047dacb9ddc95b41c45e69b78d39f19 (branch codex/first-light-level-two-lane, main
d9b696ddb+ shared-table/007 boot stack + #6679 36529f17d + #63649fffceaa9, #4339 excluded): correct title/offline menu, Resume at17:52:29.513UTC/present989. Last observed loading spinner atpresent1648/17:54:03; unhandled0xc0000005 on RenderThread, read0x40, game executable+0x17bd927; exit17:54:27.720UTC. Not a memory-guard or owned stop. Peak sampled private27.69GiB/minfree2.52GiB, three bounded trims, unchanged2GiBfree/28GiBprivate guard. No shader-type rejection or invalid indirect dimension exception before the fault.This appears consistent with #6172's failed texture lookup, but I have not yet proved that the faulting key came from the stale feedback buffer in this run. Queue0 was inside NVIDIA's compiler in the fatal thread snapshot. Before the fault, one newly used754,594-word compute pipeline took18.9s to create and another172,513-word one1.59s; that is evidence of a pipeline stall, not proof of the feedback cause. No local title patch/time scaling applied. @SleglJan does executable offset+0x17bd927 match one of your known feedback lookup sites for v01.018.000?
Both added fixes were native-tested first:30/30PASS; removing only #6364's wait block makes its unchanged fixture fail with the older-texels message; restored/rebuilt30/30PASS14.53s. Thus I am not presenting this title fault as a failure of those fixtures or a new structurizer stop. Next separate candidate is #6346 + #6273 at1f0e2b149 (source-prepared/unbuilt), plus an opt-in bounded copied-buffer ownership sampler. Keeping actual 30FPS/gameplay goal open. AI-assisted: Codex; no title bytes, descriptors, PM4 or raw logs attached.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-16T18:02:49Z.
@Scramblrrrr Yes. A read at 0x40 on RenderThread at that instruction is the failed texture-id lookup: 9 of the 11 catches in the body above are at it, and the other 2 are at the quadtree descent. That also covers your earlier RenderThread crashes at that offset after Resume (October 12-13).
What the body shows for that site, all from the runs and setup described there:
That doesn't prove the faulting key in your run came from the stale buffer. It is the same site in the same phase of the load.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T01:31:45Z.
I opened PR #6181 for proposal 1: documenting what
APS5_TIME_SCALEchanges and that host sleeps remain real time. This is diagnostic guidance only; it does not address the title’s two-second/frame-count wait or establish a GPU-pacing fix. The one-limit-at-a-time title patch and label-write/read trace remain the evidence needed before proposing runtime behavior changes.Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-18T10:57:54Z.
Oct18 Windows unpatched-title reproduction on integration ad3586f18b2594002d4ce2af639234ad86778aef (base main
e5c2b3c32plus current public 007/shared-table/resource stack, #74763ea0be648and #6606925f9a84b). RTX5070Ti617.42 / 7800X3D /32GiB. Correct title/offline menu; Resume10:54:36.623UTC/frame906; exit10:55:12.932UTC, unhandled0xc0000005 on RenderThread reading0x40 at executable+0x17bd927. Same site you previously confirmed. Not guard/owned stop: last sampled private26.28GiB/free7.26GiB, one bounded trim. No title binary patch/time scaling.The last reported compute pipeline builds before the fault were33ms,12ms,6ms,11ms (warm application cache), so this run does not show a >2s compute compile immediately before the read. That neither disproves the broader GPU-backlog/feedback hypothesis nor proves the faulting key's source in this run. Native #6606 controls pass, but its title cross-test remains inconclusive because this older crash intervened; no declared-range failure occurred and no reported fallback counter yet proves that path was used.
Current isolated diagnostic is APS5_SYNC_DRAWS=1 on the same ad358 binary and same budgets/settings otherwise. Four related GPU controls pass with the flag on. This is a pacing/correctness experiment, not a performance recommendation; old Oct13 builds were slower with it. Starting the title run now. Public integration branch is pushed, raw title data stays local. AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-18T11:04:38Z.
Same-binary synchronous-draw diagnostic finished: ad3586f18, only APS5_SYNC_DRAWS=1 added, other settings/budgets unchanged. Correct title/menu. Resume11:03:13.336UTC/frame942, exit11:03:58.398UTC (~45.06s). RenderThread0xc0000005, but this is a DIFFERENT instruction from the previous failed lookup: executable+0x17bdb56, read0xffffffffffffffff, rather than+0x17bd927/read0x40. I have not established whether it is the other quadtree site in your issue. Not a guard stop or a workaround. Default is off again for subsequent tests. No game binary/time patch. The four draw/indirect native controls passed with this flag before the title run. AI-assisted: Codex; title data remains local.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T11:18:58Z.
@Scramblrrrr yes. The new instruction in your 11:04 comment is the issue's other site, the quadtree descent: 2 of the 11 catches, and in both the key's coordinates lay past the texture's extent. The one in your 10:57 comment is the failed lookup (the other 9).
The all-ones address fits too. In both of our descent catches, the descent took a key as a node pointer. That value is non-canonical, so the load raises a general-protection fault rather than a page fault, and such a fault carries no faulting address. Linux reports it as SIGSEGV at address 0 (our dumps); Windows reports it as an access violation reading 0xffffffffffffffff (your run).
So the offset and that address show the same instruction and the same fault class, but not the same cause. Whether your key also lay past the texture's extent would need the key from your run, which the crash report doesn't carry.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-19T01:20:28Z.
Thanks for confirming both sites and the non-canonical-address explanation. I agree that the fault address alone does not establish the key's source or prove the same stale-feedback cause on Windows.
Resumed testing on a new public integration branch: https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-oct18-resume-main (188fab525; main
0c25997a5merged onto the prior ad3586f18 stack). It preserves our shared-table/resource fixes and excludes the #6188 draw-ahead experiment, whose last same-host menu run was slower. Full Windows library rebuild and native gates are in progress; this head is not yet title-tested or staged. Two newer main merges, including Windows APR read staging #6449, are reviewed and will be included before the next title run. No new crash-resolution or FPS claim yet. Raw title data stays local. AI-assisted: Codex.