Skip to content

Olympus: harden media and package ingestion - #8

Closed
bmjask wants to merge 1 commit into
xcl-dev:mainfrom
bmjask:olympus-media
Closed

bmjask wants to merge 1 commit into
xcl-dev:mainfrom
bmjask:olympus-media

Conversation

@bmjask

@bmjask bmjask commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • deduplicates concurrent DXIL compilation within and across processes
  • structurally validates cached DXIL and rebuilds corrupt entries
  • hardens RPF scanning, inflation, duplicate extraction, atomic output, truncated headers, and failure reporting
  • contains no protected-package decryption or DRM bypass

Rooted at current upstream main, including the newly landed real Opus decoder.

@bmjask
bmjask force-pushed the olympus-media branch 2 times, most recently from 996242c to 2c7d059 Compare November 21, 2026 16:45
ivall added a commit that referenced this pull request Nov 21, 2026
…io2 part, superseded by PR #3)

# Conflicts:
#	crates/xcl/src/hle/xaudio2.rs
ivall added a commit that referenced this pull request Nov 21, 2026
… flight

- compile_cached_in_with checked cached_only after the single-flight and cross-process locks:
  the title's thread (non-blocking pipeline creation) waited for a worker compiling the same
  shader. The check comes before the locks; test in concurrent_cache_misses_compile_once.
- names: XclDxilCache mutex, xcl- test directories.
@ivall ivall mentioned this pull request Nov 21, 2026
@ivall

ivall commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Thanks! Merged the reviewed version (c3049b0) in 9ebb9b1, without its XAudio2 part: #3 decodes Opus now, and the frame-duration table there had SILK / hybrid sizes off vs RFC 6716 table 2.

Follow-up in b1477f8: the cached_only check now comes before the single-flight / cross-process locks. Otherwise the title's thread waits for a worker compiling the same shader, which defeats non-blocking pipeline creation (the newer push still has the old order).

The DXC toolchain id in the cache key and validating freshly compiled DXIL are good ideas – a new PR on top of current main is welcome. Hashing the whole dxcompiler.dll byte by byte is slow in debug builds though; size + modification time would do. Closing this one.

@ivall ivall closed this Nov 21, 2026
@ivall

ivall commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Sorry – I closed this too early while you were still pushing updates, and GitHub won't let me reopen it because the branch was force-pushed since. Please just open a new PR from the same branch; it'll get a normal review and won't be closed on you. The notes above still apply (what's already on main, what I changed).

ivall added a commit that referenced this pull request Nov 21, 2026
From slot 44 on the console device's vtable holds its extensions; a title
call there no longer runs the PC method at that index.

- CreatePlacedResourceX (#44): buffers at title addresses in unified
  memory are placed in that memory (GPU VA = the address)
- CreateCommandQueueX (#48) / CreateCommandListX (#73) and #8 / #9 / #12:
  the DMA type and list IID, console queue priorities
- graphics PSO X (#60), CreatePipelineState (#86), CreateSamplerX (#61),
  GetCopyableFootprints (#38) and command signatures (#41) with console
  descs, descriptor heap type 4
- SetDebugFlagsX, pipeline (de)serialisation, page pools; any other
  extension slot is a logged S_OK stub
- test title: a DMA copy of a buffer placed at its own graphics memory
koboshchan added a commit to koboshchan/xcl that referenced this pull request Nov 24, 2026
XGTextureAddressComputer::CopyFromSubresource (vtable xcl-dev#9) takes an 8-argument ABI (this, dst, plane, sub, sample, src, row_pitch, slice_pitch), unlike CopyIntoSubresource (xcl-dev#8) which takes 7 arguments. Omitting sample shifted src/row_pitch/slice_pitch by one slot, interpreting the low 32 bits of the source pointer as row_pitch and crashing with a write access violation on row 1.

Add the sample parameter to xg::copy_from, add a unit test covering vtable xcl-dev#8/xcl-dev#9 round-trip ABI, and update xg_oracle to exercise both XCL and the console library on CopyFromSubresource.

Assisted-by: Antigravity CLI (Gemini 4 Neon)
raylitebull pushed a commit that referenced this pull request Nov 25, 2026
Part of #480.

Add integration tests comparing D3D12.X runtime wrappers against host
ID3D12Device objects and console ABI contracts across:
- ID3D12Resource Map, Unmap, GetGPUVirtualAddress (including lazy
  TITLE_ADDRESS texture fallback and UMA buffer placement), and
  WriteToSubresource
- ID3D12DescriptorHeap console slot #9/#10 start handles and
  console_heap::start lifecycle on host and console #14 heaps
- ID3D12CommandQueue GetDesc, GetTimestampFrequency,
  GetClockCalibration (host parity and pre/post-QUEUE_OLDER console
  calls), ExecuteCommandLists, Wait, Signal, and SignalX (#23)
- ID3D12Fence slot #12 64-byte-aligned completed-value cell and CPU
  Signal updates, plus ID3D12CommandAllocator::Reset (#8)

Verified on AMD Radeon RX 9070 XT (debug, release, XCL_D3D12_DEBUG=1),
AMD Radeon(TM) Graphics, and WARP.
theaustinayers added a commit to theaustinayers/xcl that referenced this pull request Nov 25, 2026
… it with

Review of d4624b7: the PC heap behind a shader-visible console sampler heap
now holds 2 048 samplers, and descriptor heap xcl-dev#8 GetDesc was not hooked, so a
title asking its 128-slot sampler heap for its description read 2 048. A title
that sizes an allocator or a loop from that count makes samplers or copies at
console handles past its 128 16-byte slots: console_heap::slot finds none
there, dev_create_sampler_x hands the handle to the PC CreateSampler as it is,
and the driver writes a sampler descriptor at that address in the title's
memory. A view heap already read twice its slots, and one whose views are in
the shared heap read no shader-visible flag. Whether the retail title calls
GetDesc on these heaps was not checked (no trace taken).

Device xcl-dev#14 now keeps the description each console CBV/SRV/UAV and sampler heap
was made with (the title's type, 4 included, count, flags and node mask) until
the heap's last Release, and xcl-dev#8 answers it to calls from the title's images,
returned through the hidden pointer called the C++ way or the C way
(this_first, as device xcl-dev#25 / xcl-dev#26). Other heaps, and every call from XCL itself
(the split slot: list_x::pc_heaps reads the PC flags), get the PC
description as before.

New test a_console_heap_describes_itself_as_the_title_made_it, on a WARP device
adopted as a title's: a shader-visible sampler heap of 128 made through device
xcl-dev#14 answers [1, 128, 1, 0] both ways while XCL's own GetDesc says 2 048; a view
heap answers the PC description until it is known as a console heap of type 4
and 64 slots, then that; both are forgotten when released; xcl-dev#8 is in the
descriptor heap's console slots. Checked that it fails with the hook answering
the PC description ("the sampler heap": [1, 2048, 1, 1]). The view heap's
recording at creation is not covered (making a view heap through xcl-dev#14 makes the
process-wide shared heap).

Tested on the software adapter only (WARP). Not run on the hardware GPU or on a
title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants