Commit Graph

9 Commits

Author SHA1 Message Date
ef205eec98 xbox_bvh_builder: review fixes for batched rehydration (RT-XDXR-BVH-REHYDRATE-BATCHED2X)
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>
2026-11-25 14:37:34 -05:00
b352aa9be9 xbox_bvh_builder: supply scratch buffer and address review feedback (RT-XDXR-BVH-REHYDRATE-BATCHED2X)
- 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).
2026-11-25 22:30:44 +03:00
cb1cb86e92 xbox_bvh_builder: rebuild from geometry and refuse source-only rehydration (RT-XDXR-BVH-REHYDRATE-BATCHED2X)
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).
2026-11-25 22:30:44 +03:00
07e89b1935 xbox_bvh_builder: implement RehydrateRaytracingAccelerationStructureBatched2X (RT-XDXR-BVH-REHYDRATE-BATCHED2X)
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)
2026-11-25 22:30:44 +03:00
273b3bdf9d [integration] Linux/Proton and native Windows: boot through the story load (RT-PROTON-STORY-LOAD)
One squashed commit of a fork that was developed on a Linux/Proton machine and
tested on two native Windows machines. On all of them the retail 1.0.2.1
package now launches, shows its launch movie, first-run pages and landing
prompt, runs the story load to its end with the loading slideshow drawing its
artwork, and enters the world phase. A first world frame is not verified yet.
docs/linux_proton.md has the setup, a healthy boot's timeline, the machines
and where it stops.

Runtime: frames in the title's own window; DirectStorage pinned reads,
page-list scatter/gather, BCPack and unshuffle with a locally generated
predictor file; pooled, device-local and deferred image backing for streamed
and placed textures; enhanced barriers into LAYOUT_UNDEFINED; a bindless table
that degrades instead of refusing a submission; a descriptor hash finalizer
(off until a library carries it); directly indexed heap offsets for compute
dispatches and VS/PS/GS draws; title buffer windows outside a fragmented
arena; opt-in device-local copies of streamed buffer views; write-fault
retries under the tracker lock, shared trackers and write-watched title memory
for native Windows; device-loss, compute-input and memory probes.

Translator: loop bounds at structured exits, the eight FidelityFX programs
that use a packed-dot form the disassembler skips, buffer bounds modes per
view kind, a compaction option, the hash finalizer option.

Tools and scripts: Linux boot scripts (Wine/Proton, no network), a Windows
boot script, the paired compute translation script.

No game data. AI-assisted (Claude Code and Codex agents), reviewed and booted
by people on the machines named in docs/linux_proton.md.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:42:12 -06:00
bfed4faf9f docs/xdxr: every build/prebuild rejection throws; say where (RT-155 review)
Lines 31, 33 and 90 still said "rejected". The Dest alignment check (0x216a0) and
the Inputs.Type check (0xcc00) throw through the same _CxxThrowException thunk as
0xe6a0; only ValidateRehydrateAccelerationStructureBuildDesc returns the HRESULT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 12:23:54 +13:00
b2b0cdaf6c docs/xdxr: E_INVALIDARG is thrown, not returned; drop a repeated sentence (RT-155)
The error block at 0x106ba stores 0x80070057 and calls
VCRUNTIME140!_CxxThrowException (0x10702, through the thunk at 0x2302e);
the export returns void. Found by @CLHelper. The §5 bullet said "not in
the package" twice; drop the second sentence (@ramenbellic).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 09:44:02 +13:00
7a70ec73bc docs/xdxr: the offline statistics layout is not in the package (RT-155)
XboxBvhBuilder.dll (1.0.2.1) only rejects or skips postbuild InfoType 0x10:
0xe6a0, called first by the batched export, fails the build with
E_INVALIDARG on any 0x10 desc, and the export's own postbuild loop skips
it (0/3 -> 0x1d540, 2 -> 0x1d7c0). Neither reads past InfoType, and none
of the package's 15 other DLLs names the type or an offline builder.
Record the RVAs and close the open question: the layout needs the
offline BVH builder, which is not in the package. RVAs only; nothing
from the DLL is reproduced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 05:38:42 +13:00
e3794131b6 docs/runtime: XDXR BATCHED_DESC2 and XDXR_STREAM_DESC layouts from XboxBvhBuilder.dll (open question 8)
Recovered from the package DLL's own reads (field accesses, element strides,
the standard-build and prebuild wrappers that construct a BATCHED_DESC2):
BATCHED_DESC2 is the public build desc, the postbuild count and pointer and
a 16-byte XDXR_STREAM_DESC (0x50 bytes); the stream desc is a size and a
pointer to 16-byte typed records, whose offsets, value types, defaults and
lookup rule are measured. The DLL rejects the offline-statistics postbuild
type for every build, so that layout is not in the package.

docs/xdxr.md has the evidence per field (RVAs only, nothing quoted from the
DLL). runtime/src/xdxr_descs.h defines the structs with static_asserts and
the DLL's stream lookup and flag defaults; xdxr_descs_test checks them and,
with a DXR d3d12.h, the public part against the SDK.
2026-11-22 03:23:37 +01:00