Maintainer fixes on top of the author's rehydration, carried over from the
reviewed branch onto the rewritten head:
- Scratch: each element of a batch gets a region of its own in one buffer
per call, at D3D12's acceleration-structure alignment, and the command list
holds that buffer until its next Reset (rt::d3d12::hold_until_reset). Before,
every element and every list shared one builder-wide buffer with no barrier
between the builds, and growing it released a buffer that builds already
recorded could still use.
- Fresh builds: a rehydrate always builds from geometry. PERFORM_UPDATE is
cleared together with SourceAccelerationStructureData, so the layer never
refits from the dehydrated stream's bytes.
- The leaf frame compressionParams gives is described as not applied yet,
which is what the code does.
- The test reads back rehydrated builds made without scratch
(ScratchAccelerationStructureData = 0), the shape the title uses.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Fix log_once call signature at line 268 (passes flag, text without format args).
- Do not copy source_data into SourceAccelerationStructureData to avoid unwanted refit
on update paths (d3d12_vulkan_device.cpp:2639).
- Allocate and supply scratch buffer via builder_ensure_scratch when the title passes
ScratchAccelerationStructureData = 0 (docs/xdxr.md §6), avoiding command list poisoning.
- Retain the leaf-frame note (compressionParams, docs/bvh.md §4a) in comments and docs.
- Remove stale deserialize references in test comments and update test coverage.
AI-assisted (Claude Code, Claude Opus 5.5).
Addresses review feedback on #1759 from @aslan2142 and @Tyrannys:
- RehydrateRaytracingAccelerationStructureBatched2X now rebuilds structures
exclusively from geometry (docs/bvh.md §4a).
- Offline console dehydrated streams cannot be directly deserialized by
PC D3D12/Vulkan drivers (docs/bvh.md §4/§4a). When source_data is present
without geometry descs, the shim logs once and refuses with E_NOTIMPL.
- Documented in docs/xdxr.md that the 4th parameter (const UINT64* source_data)
is a hypothesis denoting offline console stream pointers.
- Empty structures (NumDescs == 0 without source) are logged once and skipped.
- Updated runtime/test/xbox_bvh_builder_test.cpp and tests/test_xbox_bvh_builder_rehydrate.py
to verify refusal of source-only streams (E_NOTIMPL) and handling of empty structures.
AI-assisted (Claude Code, Claude Opus 5.5).
Implements XboxBvhBuilder::RehydrateRaytracingAccelerationStructureBatched2X
in runtime/shims/xbox_bvh_builder.cpp. The shim now rebuilds or deserializes
each acceleration structure on the command list via ID3D12GraphicsCommandList4
rather than stubbing out with E_NOTIMPL, resolving the interactive boot stop
reported by timbot103 past story-load texture streaming.
Validates count == 0 (S_OK), null list / descs (E_INVALIDARG), and adds unit
coverage in tests/test_xbox_bvh_builder_rehydrate.py and runtime/test/xbox_bvh_builder_test.cpp.
AI-assisted (Claude Code)
A hang read as "0 fps 0.0 ms (worst 0)", which looks like a slow frame. Now it reads
"0 fps, no frame for 12.5 s". title_hud_test checks it after presents stop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tester has no way to see, during a boot, whether the game is slow because of frame time, memory pressure or
pipelines compiled in the frame. With LEONIDA_TITLE_HUD=1 the window the title presents in gets, twice a
second:
- fps and the average and worst frame time from PresentX;
- private memory and working set;
- local GPU memory against the DXGI budget, and shared GPU memory;
- pipelines created and the seconds spent in vkCreate*Pipelines in the last interval (with
LEONIDA_MEM_PROBE);
- time since the first present.
A thread of its own sets the text with SendMessageTimeout, so a busy or hung window thread never holds a
present. title_hud_test drives a real window from another thread and checks the text and the shutdown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A CopyTextureRegion of the depth plane from a D32_SFLOAT_S8_UINT image into a
D32_SFLOAT one was replayed as vkCmdCopyImage. Vulkan requires depth/stencil
formats to match exactly (VUID-vkCmdCopyImage-srcImage-01548), and the NVIDIA
driver (RTX 4070 Laptop, 621.40) wrote past the end of the D32 image: the
world-start WRITE_INVALID device loss, with the fault at the first byte after a
2560x1440 D32_SFLOAT image (VK_EXT_device_address_binding_report) and this VUID
reported by the validation layer just before the loss.
depth_format_pair: two depth formats with the same depth encoding but not the
same VkFormat (D32 / D32S8, D16 / D16S8, X8_D24 / D24S8) take the image ->
scratch -> image path depth <-> colour and A8 copies already use; the depth
aspect has the same texel layout in a buffer on both sides.
replay_copy_offset_test: the D32S8 -> D32 and D32 -> D32S8 depth-plane copies
are staged (no vkCmdCopyImage, depth aspect, 4 bytes a texel), and D32 -> D32
keeps vkCmdCopyImage. Fails without the change (6 checks).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep main's first-run profile without GPU completion labels and this
branch's focused keyboard pad (LEONIDA_KEYBOARD_PAD=1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A build without SDL3 answered GameInputCreate with no devices and E_NOTIMPL
for every other slot, so the title waited at its first "press A" prompt
forever: no CI artifact or offline build could get past it.
With LEONIDA_INPUT_SCRIPT set, gameinput_no_sdl.cpp now serves one scripted
pad (an Xbox One gamepad) driven by the script alone: device enumeration
through RegisterDeviceCallback (blocking, async, dispatcher), FindDeviceFromId,
and GetCurrentReading/GetNextReading/GetPreviousReading whose gamepad and UI
navigation state follow the script. Readings are taken when the title asks,
so no thread polls. Without the variable it behaves as before.
The parser, the 300 ms timeline, the button names, the press log lines and
the UI navigation mapping move from gameinput.cpp into gameinput_script.h,
which both shims use; nothing in it needs SDL. gameinput.cpp checks the
shared SDL button numbers against SDL_GamepadButton at compile time.
gameinput_no_sdl_test --input-script (CTest gameinput_no_sdl_script) checks
the scripted pad on a fake clock. Docs: runtime/README.md, docs/gameinput.md,
docs/linux_proton.md, docs/README.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The launcher runs gta6rt.exe --run once under Wine on Linux, headless on a
private kwin_wayland --virtual --xwayland session (Xvfb has no DRI3, so RADV
cannot present there) or on the current display with --visible. Sound is off
(Wine's audio drivers disabled, Pulse/PipeWire/ALSA pointed at nothing,
LEONIDA_AUDIO=silent for the runtime's silent output endpoint), --device pins
the Vulkan device through MESA_VK_DEVICE_SELECT, and a hard time limit, a lock
and full teardown bound the run. Every path comes from arguments or the
environment.
tools/game_run_summary.py prints counts only: run time, end, exceptions by
code, D3D12 calls by outcome, presents, the top failing calls and the [rt]
lines by category with numbers masked. It never prints a log line.
Tests need no game, Wine or GPU: the script against stubs, the summary on
synthetic run folders. docs/linux_proton.md describes the script.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>