Skip to content

Implement XSystemGetDeviceType/PLS thunks and Opus audio carrier parsing - #1

Closed
Lum7nt wants to merge 1 commit into
xcl-dev:mainfrom
Lum7nt:feature/audio-opus-decoder
Closed

Lum7nt wants to merge 1 commit into
xcl-dev:mainfrom
Lum7nt:feature/audio-opus-decoder

Conversation

@Lum7nt

@Lum7nt Lum7nt commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • XSystem Thunks (api.rs): Implemented slot 5 (XSystemGetDeviceType) returning Anaconda (Xbox Series X) device type (7) and wired XPLS persistent storage COM class candidate.
  • XAudio2 Opus Bridge (xaudio2.rs): Added WAVE_FORMAT_OPUS (0x704F) carrier voice handling, RFC 6716 packet header parsing, 48 kHz sample duration calculation, and audio telemetry.
  • Verification: Added unit tests for Opus packet header decoding; all 132 library tests pass.

@ivall

ivall commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Hey, thanks for this! Both XGameRuntime bits already landed on main in the meantime, and slot 5 is actually XSystemGetAppSpecificDeviceId (device type comes from the registry), and the real PLS class is f4faf4d4. The Opus part only outputs silence for now and the frame durations are a bit off vs RFC 6716, so I'll close this one. If you're up for a real Opus decoder, that'd be awesome as a new PR on top of current main!

@ivall ivall closed this Nov 21, 2026
ivall added a commit that referenced this pull request Nov 22, 2026
… processor, GameInput

- Console view descriptors are values: titles create them in a CPU-only heap and
  copy them into the shader-visible one as memory (the header's inline
  CopyDescriptorsSimple). T# word 0 was an index into each heap's own PC heap, so
  every copied T# named an empty descriptor (all frames black). All console view
  heaps now share one shader-visible PC heap (T# word 0 indexes it, lists bind
  it, the title's own heap is a CPU-only mirror).
- Write-watch scans cover only what the GPU sees (textures kept in step, sparse
  tiles with video memory) instead of 16+ GiB per submit: ~2 -> ~40 fps.
- Pixel shaders read lanes of their own quad with QuadReadLaneAt (helper lanes
  included): derivatives taken across a quad were wrong along triangle edges
  (seams on large quads); test with the console compiler.
- acphal / xapu: APU memory, the processor's channel (commands acknowledged,
  audio frames ticking), SHAPE context arrays, the decoder answering with
  silence - the title's audio setup no longer aborts (still silent: SHAPE is
  not run).
- GameInput: the GDK v0 interfaces with one gamepad (XInput controller,
  keyboard), ordinal #1; XCL_PRESS_A_AT for tests. The title screen takes A.
- Diagnostics under XCL_TRACE_FRAME (heap census, descriptor copies, full-screen
  dispatch arguments), sparse upload timing; HANDOFF updated.
vincentes added a commit to vincentes/xcl-wasm that referenced this pull request Nov 24, 2026
A retail title imports GameInputCreate as gameinput.dll's xcl-dev#1: the host
finds its functions by name, so the loader names that ordinal. The
object then had four of the interface's 22 methods; the title called a
later one and jumped to 0. There are no devices: a reading or a device
is not found, and a callback is registered and never called.

Tested: cargo test -p xcl-guest on macOS (aarch64), 2 new tests. Not
built or tested on Windows.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
raylitebull added a commit that referenced this pull request Nov 25, 2026
…direct-branch BVH check

In the Wave 10 run (202f649), xcl-pso-pre-* preload worker 25276 speculatively launched 95cc13288a27a96e (71,816 B console CS -> 1,061,720 B DXIL) at t=156.5s at THREAD_PRIORITY_LOWEST, holding BIG_COMPILES slot #1 (because GIANT_DRIVER_COMPILE was 4 MiB) and ~3-4 GB of compiler commit for >144s through t=300s.

- Lower GIANT_DRIVER_COMPILE from 4 MiB to 900 KiB in real.rs so >= 900 KiB monster DXIL shaders compile in their own dedicated 1-slot GIANT_COMPILES lane without starving MEDIUM_COMPILES (256-512 KiB) or BIG_COMPILES (512-900 KiB).
- Add SubmitFlags + submit_lazy_with_flags / submit_with_flags in pso_async.rs and set spared/bvh_traversal/deprioritized atomically before inserting into PENDING or queues; exclude deprioritized/heavy/BVH/spared pipelines from speculative xcl-pso-pre-* preloading so THREAD_PRIORITY_LOWEST preload workers never launch >1 MiB compiles ahead of first use.
- Mark heavy deprioritized producers wanted before enqueueing in resolve_wait_for so needed producer dispatches jump straight to the front of PsoQueue.
- Scan RDNA2 compute machine code directly for IMAGE_BVH*_INTERSECT_RAY in gpu/effects.rs (100% cache-safe; not in build.rs) so large RT shaders with s_setpc_b64/s_swappc_b64 indirect branches are still recognized as BVH traversal shaders instead of returning false when conservative effects::of() returns None.

Assisted-by: Antigravity (Gemini 4 Neon High)
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