Repository navigation
Bathyal: boots a newer retail title to its menu and intro on an RTX 4090 - #6
Merged
Merged
Conversation
CONTRIBUTING.md: small single-purpose PRs (~400 changed lines, stacked when dependent), Area: commit subjects as in the history, tests with every logic change, licence and provenance rules, and an AI policy (disclose tool and model, the author answers for every line, tests actually run, AI test reports welcome). AGENTS.md: the same rules as instructions for coding agents, plus build and test commands and what an agent must never do. CLAUDE.md loads both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… title, checked by PR checks CONTRIBUTING.md gets the merge requirements: both required checks green (CI, PR checks), the whole suite run on a GPU with its counts, and for a runtime change (crates/xcl/src outside tests) two xcl-smoke blocks from scripts/smoke.ps1 - built from main and from the PR's head commit with no uncommitted changes - with no device removal or crash. The maintainer runs the suite and a retail title again on every merged batch. - scripts/smoke.ps1: runs a title for a fixed time (network off, XCL_ACTIVITY) and prints the xcl-smoke block: commit, GPU, exit, frames shown, presents, device removals, crashes, peak commit. - .github/pull_request_template.md: Tested / Regression run / Not tested / AI use. - .github/workflows/pr-check.yml: refuses a description without those sections, and a runtime change without a smoke block made on the PR's head commit. - AGENTS.md / CLAUDE.md (from #212): the same rules for agents; AI use is disclosed in the PR's AI use section, a commit trailer is not required.
…ses them in AI use XCL is low-level code (a recompiler, a console runtime, D3D12 memory and synchronisation): small and local models get it subtly wrong, and every wrong PR costs a review. CONTRIBUTING.md and AGENTS.md: code comes from frontier models; PRs written with Qwen, DeepSeek, Llama, Mistral, Gemma, Phi or their distills are closed without a review. The PR checks workflow refuses a description whose AI use names one of them (and now reads CRLF descriptions).
… read at the request's turn A retail title keeps its destination page arrays in its own tables and fills an entry after EnqueueRequest. The array is snapshotted at enqueue (titles also pass it on the stack), so such a request wrote to page 0 and was refused with E_ACCESS_VIOLATION: over 8,000 of them in the first 100 s of the title's streaming, and what they carried never arrived. An entry that is 0 in the snapshot (no page has that number) is read again when the request runs; entries that had a page keep the snapshot's. Measured on the title (RTX 5090, 170 s): 16,384 such requests found their page at their turn, 2,227 still had 0 and are refused as before. Assisted-by: Claude Code (Claude Fable 5.2)
A retail title reserves its video memory twice: one reservation it can write (its Bink decoder puts the frames there), then one of the same size with no CPU access, where it places the textures its YUV -> RGB pixel shader samples. On the console the second is the GPU's view of the first. Under XCL it was separate, empty memory: the four planes read as zeros, which the conversion turns into a flat green picture for the whole intro movie. kernelx pairs an inaccessible reservation with the last accessible one of the same size (dropped when either goes); title_textures reads a texture's bytes, and watches its CPU writes, at the address the pairing names. Textures without such a view are unchanged (src == va).
From ivall/xcl#150 by @Yeetbot159, squashed; conflict resolved by hand.
Upstream docs only. Drop upstream's pr-check.yml: this fork runs ci.yml.
# Conflicts: # crates/xcl/src/hle/d3d12x/title_textures.rs
…om main; game data refused From a review of the check: it looked for crashes and device removals anywhere in the description, so a PR fixing a crash on main failed on main's run, and nothing made the two runs come from different commits. The checker is now scripts/pr_check.py: the PR's xcl-smoke block must be its head commit with no uncommitted changes, the other a commit on main (the compare API), both of the same title for the same time; crashes and device removals count in the PR's run only, which must keep 80 % of main's frames and stay under 125 % of its peak commit. The workflow runs as pull_request_target with main's checker: a PR can no longer change what checks it, and nothing of the PR is checked out or run (only its description and file list are read through the API). Game data: .gitignore keeps game packages, archives, executables, video, audio banks, textures and dumps out, and the check refuses a PR adding one, a MicrosoftGame.config other than the test title's, or any binary outside tests/data/ or over 1 MB.
From ivall/xcl#294 by @simnJS, squashed.
… read at the request's turn From ivall/xcl#289 by @theaustinayers, squashed.
From ivall/xcl#270 by @cmt8, squashed.
…ent order From ivall/xcl#263 by @ryosen0, squashed.
… and host From ivall/xcl#259 by @slopgobblercobbler, squashed.
An R9G9B9E5 target with unordered access became R16G16B16A16_FLOAT, which holds the values exactly but leaves no way to write the packed 32 bits (an R32_UINT view of it is an invalid format pair). It is R32_TYPELESS now, the console's 32 bits a texel: R32_FLOAT for the shaders that write values, R32_UINT for those that write the packed bits. An sRGB texture with unordered access is typeless on the PC (it has no sRGB UAV): the UAV views take the UNORM format, the SRV / RTV views keep sRGB. A UAV / SRV / RTV without a description of a typeless resource gets a typed one, which the console's own format describes. GetResourceAllocationInfo answers a format the PC has no layout for with the console's layout of a same-bits-per-texel stand-in instead of u64::MAX.
From ivall/xcl#299 by @SandimL, squashed.
…the CPU view (retail intro video, no green screen) From ivall/xcl#283 by @jessenic, squashed. The squash also carries #252, which #283 is stacked on (write-watched fallback for GPU-visible title memory outside the windows). Pairing is stricter than the PR: a no-access graphics reservation of 64 KiB pages is the GPU view of a same-size CPU reservation only when that one is the immediately preceding reservation and the only same-size CPU view without a GPU view; otherwise the reservation stays unpaired and a log line says so. Our `Entry::seq` from #269 is kept (uploads in placement order).
The console audio path is xapu (the hardware Opus decoder) into SHAPE (the console mixer). XCL answered every xapu Process command with silence and never ran SHAPE, so a title that mixes through the console stayed mute. xapu now decodes each Process command's Opus packet with hle::opus (Windows' Media Foundation decoder; libopus from opus.dll where Windows has none) into the title's float32 output buffer, honoring first_frame (the pre-skip), and hle::xaudio2::console_pcm plays each decoder stream on a system XAudio2 engine of its own, one float voice per stream. SHAPE is still not run: the streams play without the console mixer's volumes, panning and effects. report.json gets xapu_* and console_pcm_* counters; xcl.log a summary line every 5 s. XCL_TRACE_APU=1 logs the commands and their structures. Ported from ivall/xcl#294 (simnJS). Unit tests cover the pre-skip copy and the Process output contract.
…aches creation Revert the R9G9B9E5_SHAREDEXP targets from R32_TYPELESS back to R16G16B16A16_FLOAT, as on the base: an SRV of the typeless resource was R32_FLOAT over the packed bits, and its RTV lost G, B and A. A shader view with no description of a texture `pc_resource_desc` made typeless now names the format the title created it with (recorded per resource at creation), so an sRGB texture with UAVs is read as sRGB instead of naming a typeless format or format 0. CreatePlacedResourceX creates a format the PC has no layout for (5..8, 66, 68, 69) with the same stand-in its allocation query answered for, so creation no longer fails after the query succeeded. Tests: srgb_uavs_and_unsupported_allocation_formats, unsupported_formats_are_created_with_the_query_standin, typeless_resources_get_typed_uav_descs.
GetWriteWatch walks each range in the kernel, one range after another, before every submit; on a newer retail title that walk held the submitting thread for most of each frame (194 s of write-watch in one session, the CPU and GPU both near idle). Large sets are split over up to 8 long-lived threads (XCL_WATCH_THREADS, 1 = the serial loop). Each range is still read and reset by one call, so the dirty set is unchanged.
…ext2 # Conflicts: # CONTRIBUTING.md
…every submit) Measured on a newer retail title: about 15 ms of GetWriteWatch per submit over 2.7 GB of mapped sparse tiles, at about 5 submits a frame. The thread pool did not help (the kernel serialises the walks), so XCL_WATCH_THREADS now defaults to 1.
…thyal/next2 # Conflicts: # crates/xcl/src/hle/acphal.rs
…next2 # Conflicts: # crates/xcl/src/hle/d3d12x/title_textures.rs
…next2 # Conflicts: # crates/xcl/src/hle/d3d12x/title_textures.rs # crates/xcl/src/hle/kernelx.rs
…n (this fork's rules live in AGENTS.md)
DirectStorage: a destination page array entry that is 0 at enqueue is read at the request's turn
…src, not a second va
# Conflicts: # .github/workflows/pr-check.yml # .gitignore
… the driver From ivall/xcl#303 by @pedrocalazans05, squashed.
…L_WATCH_PER_FRAME=1 gpu_sparse_vram_descriptors_buffers_and_xmem showed the cost: descriptors written between two submits of one frame missed the second submit. The parts test takes the thread count as an argument instead of the environment. (cherry picked from commit b267707)
GetWriteWatch costs a fixed part per call and a part per page. Measured on a 2 GiB write-watched reservation on the RTX 4090 machine: about 6.9 us a call plus 0.35 us a MiB (512 MiB in one call: 0.28 ms; the same bytes in 512 calls of 1 MiB: 3.79 ms). A look over 3 GiB of tiles in hundreds of ranges is therefore mostly call overhead. WATCH_GAP rises from 1 MiB to 16 MiB, under the break-even gap of about 19 MiB, so a gap is walked only where that is cheaper than the call it removes. A call whose output buffer fills leaves the rest dirty and the next call walks the whole range again; the buffer now grows (4x, up to 4M entries) so one call holds what a range has. The timing line now prints ranges and bytes watched, and a Windows test runs watch_into with more dirty pages than the buffer starts with.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #4 and #5. Everything from #4 (29 XCL PRs + rebrand) plus:
Tested on Windows 11, i9-14900K, RTX 4090: cargo test --workspace (test-title e2e skipped): 788 passed, 0 failed. A newer retail title boots to its menu, shows the copyright screen and plays its intro movie with a picture; after that it loads with a black screen at about 4 fps (open work: DirectStorage read failures, BCPack BC5/BC7, CopyMemoryToMemoryX outside unified memory, mesh pipelines with an MS in the AS slot). Content gate: 0 findings. AI-assisted.