Files
BearddOddity 53f49ad79f pb_exec: review fixes; the DMA walk becomes opt-in
Review of #162 (round 2):

- The walk stops at PUT inside a method's parameters and finishes the
  same method when PUT moves, as the DMA engine does. It no longer runs
  on through stale ring contents, and it no longer reads the leftover
  parameters as headers (D3D streams large inline arrays across kicks).
  A CALL inside a CALL stops the walk instead of overwriting the return
  address.
- fetch_attr checks every vertex read against guest memory, so a garbage
  32-bit index drops the batch instead of reading past guest RAM. Surface
  writes are refused outside guest memory and on the thread stacks, as
  they already were on the image.
- 2x2 anti-aliasing: the framebuffer window takes every other row
  (xbox_FramebufferWindowSetAA), and the screen-space fallback scales its
  vertices like the clip rect.
- s_xf and s_bverts are allocated on first use (about 13 MB).
- Tests: PUT inside a method, nested CALL and self-jump in nv2a_pb_walk;
  a garbage index, lighting below the clamp with an attenuated local
  light, and the 0x0310 latch in nv2a_ffp_backend.
- Docs: the back-end advice is marked as coming from a back end not in
  this tree.

The Burnout 3 run: with RECOMP_PB_EXEC=1 the DMA walk froze it at the
Crash Nav menu and in the garage, where v0.13.0 runs. A freeze report put
the main thread in KeWaitForSingleObject under D3D's fence wait: told
exactly how far the GPU has got, D3D patches a software method into the
pushbuffer and sleeps on the event the GPU's interrupt for it would set,
and this runtime does not deliver that interrupt. The walk commit alone
reproduces it. So the walk is now opt-in, RECOMP_PB_WALK=dma, and the
default is the segment scan v0.13.0 used, with 0x0310 unmodelled as
before. In the default mode Burnout 3 runs Crash Nav and loads the car,
with no faults. Under the walk, a project that mirrors its fence
(xbox_Nv2aMirrorFence) gets a 0x0310 latch whose fence bits match the
mirrored word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 06:33:59 -05:00
..