Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6e06665
D3D12.X: R9G9B9E5 render targets and UAVs are half floats
T-Crypt Nov 23, 2026
c842289
Lazy physical pages: a thread that loses the race to commit a page re…
T-Crypt Nov 23, 2026
4bbb90d
KernelX: GPU-visible title memory outside the windows is write-watche…
T-Crypt Nov 23, 2026
2d2a4ce
Physical pages: a scatter or map home of n pages costs O(n), not O(n²)
T-Crypt Nov 23, 2026
0bc116f
Shaders: O(1) LRU shader cache, compile coalescing, and mesh CS caching
T-Crypt Nov 23, 2026
06c9125
Precompile --pipelines: driver compiles on threads of their own, the …
T-Crypt Nov 23, 2026
473b632
XGameRuntime: XCL's own XAsync when the system runtime refuses to ini…
T-Crypt Nov 23, 2026
f3dcd22
Compute groups that are not whole waves: padded where the program can…
T-Crypt Nov 23, 2026
a8ffa01
Recompiler: image_sample_b_o / d_o / cd_o / c_o move the offset by th…
T-Crypt Nov 23, 2026
b82c6c1
Diagnostics: thread dumps unwind a copy of the stopped thread's stack
T-Crypt Nov 23, 2026
f38044a
XGameRuntime: try_update instead of the deprecated fetch_update
T-Crypt Nov 23, 2026
5d48cf6
SSE4a on Intel CPUs: MOVNTSS and MOVNTSD emulated
T-Crypt Nov 23, 2026
a4e30e3
TLS: preserve Characteristics alignment and fix on_thread_attach cont…
T-Crypt Nov 23, 2026
05d026d
Recompiler: complete remaining RDNA2 integer CLAMP=1 saturation (#105)
T-Crypt Nov 23, 2026
6ff7ee8
DirectStorage: BCPack entropy stage for all modes, BC1 blocks rebuilt
T-Crypt Nov 23, 2026
51b4fbc
Config: recreate xcl.toml only on NotFound and resolve memory mode ca…
T-Crypt Nov 23, 2026
4099e53
Present: configure HDR swapchain color space via SetColorSpace1 (#103)
T-Crypt Nov 23, 2026
91aa44b
Report: lock-safe crash report persistence under contention and re-en…
T-Crypt Nov 23, 2026
91fe052
Recomp: clamp 64-bit float results to [0.0, 1.0] instead of saturate …
T-Crypt Nov 23, 2026
50619c5
fix(gpu/run): keep descriptor heaps alive, harden device loss handling
T-Crypt Nov 23, 2026
f9989c2
reaches its title screen and menus: GPU title memory in large pages, …
T-Crypt Nov 23, 2026
17b0669
FFI: use extern "system-unwind" across guest-reentry boundaries (#106)
T-Crypt Nov 23, 2026
83d31e0
recomp: memory window from the full address, carry in 32 bits (#123 a…
T-Crypt Nov 23, 2026
6f5e699
Pixel shaders: masks hold the helper lanes (#105 item 1)
T-Crypt Nov 23, 2026
0f5b6ff
Crash diagnostics: thread dump at the unhandled exception; XCL_TRACE_…
T-Crypt Nov 23, 2026
8293b75
D3D12.X: pipelines in two passes are drawn (console MS via DispatchMe…
T-Crypt Nov 23, 2026
e38ca3d
DXC memory gate: reserve only the running compiles' growth, no stampe…
T-Crypt Nov 23, 2026
c1cc1dd
Memory windows from the descriptor heap (no per-access switch); NVIDI…
T-Crypt Nov 23, 2026
c90ed70
A memory line at every crash and while the title runs: process and sy…
T-Crypt Nov 23, 2026
10659e5
Rebrand to Bathyal: bathyal.exe, CLI help and version, launcher windo…
T-Crypt Nov 23, 2026
9a9bafc
Merge bathyal/xcl-recomp
T-Crypt Nov 23, 2026
123a4e0
Merge bathyal/xcl-187-b
T-Crypt Nov 23, 2026
83faa93
Merge bathyal/xcl-diag-b
T-Crypt Nov 23, 2026
e02786f
Merge bathyal/rebrand
T-Crypt Nov 23, 2026
79a59ac
tests: CARGO_BIN_EXE_bathyal in every e2e test
T-Crypt Nov 23, 2026
349c848
D3D12.X: title textures on shared 64 KiB pages of video memory - vide…
T-Crypt Nov 23, 2026
db5c0b2
VS / PS whole-wave reductions as wave operations (partial waves, ever…
T-Crypt Nov 23, 2026
e99beca
D3D12.X: draws wait at most 4 s a frame for pipelines still building …
T-Crypt Nov 23, 2026
cf87688
Window title: pipelines active, dormant lazy builds excluded
T-Crypt Nov 23, 2026
0b76b29
tests: skip hardware-only GPU tests on a software adapter
T-Crypt Nov 23, 2026
042f4ff
Merge bathyal/xcl-267
T-Crypt Nov 23, 2026
b9d0c0c
Merge bathyal/xcl-misc
T-Crypt Nov 23, 2026
d983901
Merge remote-tracking branch 'origin/bathyal/next-ci-fix' into bathya…
T-Crypt Nov 23, 2026
a0f8435
Merge main into bathyal/next
T-Crypt Nov 23, 2026
8503f07
CI: drop upstream's PR-description check (needs scripts/smoke.ps1, wh…
T-Crypt Nov 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: GPU test results
url: https://github.com/ivall/xcl/issues/42
about: Results of the test suite on your GPU go to issue #42, not a new issue.
url: https://github.com/T-Crypt/bathyal/issues
about: Results of the test suite on your GPU: open an issue titled "GPU results: <GPU>".
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/game.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body:
value: |
Every run writes a report and a log to `%LOCALAPPDATA%\XCL\<title>\logs\` (`report.json`, `xcl.log`; the previous run's are `report.prev.json`, `xcl.prev.log`). They say most of what is needed – please attach both.
Do not attach or link game files, dumps or anything from a game package. XCL works only on unpacked games you own and does not help with DRM.
Do not attach or link game files, dumps or anything from a game package. Bathyal works only on unpacked games you own and does not help with DRM.
- type: input
id: game
attributes:
Expand All @@ -26,7 +26,7 @@ body:
- type: input
id: xcl
attributes:
label: XCL version
label: Bathyal version
description: The release, or the commit you built (`git rev-parse --short HEAD`).
validations:
required: true
Expand All @@ -41,7 +41,7 @@ body:
id: windows
attributes:
label: Windows version
description: "`winver` – and whether the D3D12 Agility SDK is next to xcl.exe (Windows 10)."
description: "`winver` – and whether the D3D12 Agility SDK is next to bathyal.exe (Windows 10)."
placeholder: "Windows 11 24H2 (26100.4061)"
validations:
required: true
Expand All @@ -56,5 +56,5 @@ body:
id: console
attributes:
label: Console output
description: What `xcl run` printed at the start and after the game exited.
description: What `bathyal run` printed at the start and after the game exited.
render: text
7 changes: 4 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ A title's executable is untrusted code until it has proven itself. Before its fi

1. Check its SHA-256 against a source you trust.
2. Keep it out of the read-only package folder; build a game folder with `scripts\setup-game-folder.ps1`.
3. Block its egress: `scripts\block-egress.ps1` (outbound block on `xcl.exe`; the title runs inside it).
3. Block its egress: `scripts\block-egress.ps1` (outbound block on `bathyal.exe`; the title runs inside it).
4. Run on a machine with no personal accounts or sensitive data when you can.

## Build, test, run (Windows)

```powershell
cargo build --release --workspace # target\release\xcl.exe
cargo build --release --workspace # target\release\bathyal.exe
.\scripts\test.ps1 # cargo build + cargo test --workspace
.\scripts\run-title.ps1 -Game D:\games\title # precompiles caches once, then runs; logs in %LOCALAPPDATA%\bathyal\runs
```
Expand All @@ -43,7 +43,8 @@ git fetch xcl
git merge xcl/main # on a branch; keep our README header and NOTICE.md
```

Binary, crate and `XCL_*` names stay XCL's so these merges stay clean.
The program is `bathyal.exe`. The crate, module paths, `XCL_*` settings and the `%LOCALAPPDATA%\XCL` data
folder keep XCL's names so these merges stay clean; rename them only together with upstream.

## Notes carried over from Leonida

Expand Down
16 changes: 16 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Claude Code

The instructions for agents in this repository are in `AGENTS.md`, and the rules for every
contributor are in `CONTRIBUTING.md`. Both apply to you:

@AGENTS.md
@CONTRIBUTING.md

Specific to Claude Code:

- Plan a task that spans more than one subsystem or more than ~400 lines (plan mode), and propose
how to split it into PRs before you write code.
- Run the tests and report the real output; do not stop at "the tests should pass".
- Fill in the **AI use** section of the PR description with Claude Code and your exact model name.
- For a runtime change, run `scripts/smoke.ps1` on main and on the PR's head commit and paste both
`xcl-smoke` blocks; do not write or edit them by hand.
199 changes: 199 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
# Contributing to XCL

Thanks for helping. XCL gets far more pull requests than one maintainer can read carefully, so
these rules exist to make every PR **cheap to review and safe to merge**. A PR that ignores them
may be closed without a review, however good the code is.

AI tools are welcome (see [AI-assisted contributions](#ai-assisted-contributions)). The rules are
the same for code written by hand and by an agent.

## What a PR needs to be merged

XCL gets more pull requests in an hour than anyone can test by hand, most of them written with AI
tools. So a PR is merged only when it shows that it was tested and that it breaks nothing. These are
checked before anything else; a PR that does not meet them waits (or is closed after a week).

1. **Both required checks are green:** `CI` (build and tests on Windows, no GPU) and `PR checks`
(the description: the sections below, and the regression runs when they are needed).
2. **The whole suite ran on a GPU**, with the counts in **Tested**
(`cargo test --workspace -- --test-threads=4`: N passed, N failed, N ignored, and the SKIPPED tests).
3. **A PR that changes the runtime** (`crates/xcl/src` outside tests) **has a regression run on a real
title**: `scripts/smoke.ps1 -Game <your game folder>` built from `main` and built from the PR's head
commit, both `xcl-smoke` blocks pasted under **Regression run**. The PR's block must name its head
commit with no uncommitted changes: rerun it after every push. It must show no device removal and
no crash, at least as many frames as `main` and no much higher peak commit. A run on a title that
does not reach the code the PR changes still counts as a regression check; say what it does not
cover under **Not tested**.
4. **No regression on the maintainer's run.** The maintainer merges in batches: the whole suite and a
retail title run again on the merged tree, on an AMD RDNA4 GPU. A PR that breaks either is taken
out of the batch and gets a comment with what failed.
5. **Up to date and reviewable:** it merges into `main` without conflicts, and keeps to the size and
scope rules below. A PR that duplicates one already merged is closed.

A test result that was not produced by a real run on the hardware named gets the PR closed.

## Before you start

1. **Search open PRs and issues first.** Several PRs have solved the same problem at once and all
but one were closed. If someone is already on it, review or test their PR instead.
2. **Say what you are doing.** For anything bigger than a small fix, comment on the issue (or open
one) with the plan in two or three lines before writing it. That avoids duplicate work and wasted
effort on a direction the maintainer would not take.
3. **One problem per PR.** If you find a second bug while working, it gets its own PR.

## Pull requests: small and single-purpose

The smaller the PR, the faster it gets reviewed and merged.

- **One logical change per PR.** A fix, a feature, a refactor and a test-only change are four PRs,
not one. "While I was here" changes go into a separate PR.
- **Size target: under ~400 changed lines**, not counting generated files and test data. Over ~800
lines, the description must say why it cannot be split. Most large PRs can be split.
- **How to split** a large piece of work, in roughly this order:
1. preparation that changes no behaviour (moving code, a new helper, a renamed type),
2. new code behind a check or not yet called, with its tests,
3. turning it on,
4. diagnostics, logging and env-var switches, each on its own.
- **Stacked PRs** are fine when one change depends on another. Open each PR against `main`, say
`Stacked on #N` at the top of the description, and make it clear which commits belong to this PR.
Each PR in the stack must make sense when reviewed on its own.
- **No drive-by reformatting.** The tree is not `rustfmt`-clean. Do not run `cargo fmt` on whole
files or the whole crate: format only the lines you change. Reformatting buries the real diff.
- **No unrelated churn:** no renames, reordering, comment rewrites or dependency bumps the change
does not need.
- Keep the PR up to date by rebasing onto `main`, not by merging `main` into it.
- Open the PR as a **draft** until it builds, its tests pass and you have checked it yourself.

### PR description

Use this outline:

```markdown
<What changes and why, in a few sentences. Link the issue: "Fixes #N" / "Part of #N".>
<If it is stacked: "Stacked on #N; only the top commit belongs here.">

**What is in it**
- one bullet per commit or part, with the file it lives in

**Tested**
- hardware (GPU + driver, CPU), Windows build, Rust version, debug/release
- commands run and their results, e.g. `cargo test --workspace -- --test-threads=4`: 541 passed, 0 failed, 21 ignored
- `SKIPPED` GPU tests on your adapter, if any
- game checked (if any), and what got better, with numbers if you have them

**Regression run**
- for a runtime change: the two `xcl-smoke` blocks (main, this PR's head) – see above

**Not tested**
- what you could not check, e.g. AMD / NVIDIA, the retail title, wave32-only GPUs

**AI use**
- none / which tool and model (e.g. Claude Code with Claude Opus 5.5), and for what (see below)
```

"Not tested" is required. An honest "not tested on AMD" is fine. A test you did not run listed as
passing is not, and gets the PR closed.

## Commits

History is merged with merge commits, so every commit on a PR ends up in `main`.

- **Scope prefix + outcome**, as in the existing history:
```
Recompiler: round f16 conversions and products to nearest-even by default
VFS: preserve the destination when an overlay rename fails
D3D12.X: draws with untranslated pipelines get the title's root signature
```
The prefix is the subsystem: `Recompiler`, `D3D12.X`, `DirectStorage`, `XGameRuntime`,
`kernelx`, `XAudio2`, `VFS`, `Memory`, `TLS`, `PE loader`, `Shaders`, `Frame clock`, `xcl run`,
`Tests`, `e2e`, `Scripts`, `README`, `Docs`, `Issue templates`. Use one that exists already when it fits.
No `fix:` / `feat(...)` style prefixes; this repo does not use Conventional Commits.
- Subject line of about 72 characters or less, saying what the change does, not "update file.rs" or
"fix bug".
- The body (optional for small changes) says **why**, and anything a reviewer could not see from the
diff: the root cause, what was measured, what was ruled out.
- **One logical change per commit.** Each commit builds and passes the tests on its own, so `git bisect`
works.
- **No fixup commits in the final PR**: squash "fix review", "wip", "fmt", "oops" commits into the
commit they fix before asking for review (`git rebase -i`, then force-push).
- Reference issues as `(#123)` in the subject or `Fixes #123` in the body.

## Tests

Add or change a test when the change touches logic: a bug fix gets a test that fails before the fix
and passes after it, and new behaviour gets a test that shows it working. Docs, comments, logging
and pure renames need no test.

- **Unit tests** go in a `#[cfg(test)] mod tests` in the same file, the way the rest of the crate does it.
- **Integration / end-to-end tests** go in `crates/xcl/tests/`. The e2e test drives our own console
title in `tests/testtitle` / `tests/testgamedll`: extend it when a change concerns the path a title
takes.
- **GPU tests** must run without a GPU too: when the adapter cannot run them, call
`gpu::recomp::runner::skip_test("no GPU" | "no DXC" | "no wave64" | "no mesh shaders")` and return.
Never mark a test `#[ignore]` only so that it passes.
- **Tests on game data** read files the contributor owns through the `XCL_SAMPLE_*` variables
(see README / `scripts/test.ps1`), and pass without doing anything when the variable is not set.
**Never commit game data**, console SDK headers or binaries, or output dumped from a game.
- **Recompiler instructions** get a per-instruction GPU test compared against an expected result,
like the existing ones.
- Run the whole suite before opening the PR:
```powershell
.\scripts\test.ps1 # cargo build --workspace + cargo test --workspace
```
XCL builds and runs on Windows only. If you could not run the tests (e.g. you work on macOS or
Linux), say so in **Not tested**; a PR with no Windows test run waits until someone runs one.

## Licence and provenance

XCL is **GPL-2.0-only**.

- Dependencies must be GPL-2.0-compatible (no Apache-2.0-only, no GPL-3.0). New dependencies need a
reason in the PR description; avoid them for a few lines of code.
- Code ported or adapted from another project needs a provenance note in the file (project, URL,
licence) and an entry in `THIRD_PARTY.md` when it is new.
- WinDurango (LGPL-3.0) is a reference only: no code is ported from it.
- Nothing from the console SDK: no headers, no binaries, no copied documentation.
- Generated files (`*_spec.rs`, tables) come with the script in `scripts/` that generates them, and
the PR says how they were generated. Do not edit them by hand.
- Nothing for decrypting or getting around DRM.

## Docs

- `README.md` tells users what works. Update it when your change makes something work (or stop
working) for them.
- `HANDOFF.md` and `docs/specs/` are the maintainer's design and status notes. Do not rewrite them in
a feature PR; if your change makes a statement in them wrong, point that out in the PR description.
- Everything in the repository (code, comments, commit messages, docs) is in English.

## Reviews and test reports

- **Test results on your GPU** go to [#42](https://github.com/ivall/xcl/issues/42), not a new issue.
- Testing someone else's PR helps the most when it follows the **Tested / Not tested** outline above
and names the exact commit tested. Post one comment and edit it when you rerun the tests; do not
post a new comment for every run.
- **AI-written test reports are welcome** when they come from a real run: the exact commit, the
hardware, the commands and their results. Say which tool and model wrote the report.
- **AI reviews:** check each point yourself, post only what you confirmed, and say that a tool helped.
- Reply to review comments in the thread, push the fix (squashed into the right commit), and mark the
thread resolved only once it is addressed.

## AI-assisted contributions

You can use any AI tool. In return:

- **You are the author and you are responsible.** You have read every line of the diff, you
understand it, and you can answer questions about it without asking the tool again. "The AI wrote it"
is not an answer in a review.
- **Disclose it** in the PR's **AI use** section: the tool, the model, and what it did (wrote the
code, wrote the tests, wrote the description, only reviewed). A trailer in the commit naming the
model, such as `Co-Authored-By: <model>` or `Assisted-by: <tool> (<model>)`, is welcome too.
- **The tests were run, not just written.** Results in the PR come from a run you did, on hardware
you name.
- **A person opens the PR.** No PRs or issues opened by an unattended agent.
- **Keep the description short and true.** Leave out generated filler, marketing tone and claims
nobody measured. A reviewer should be able to read the description in one minute.
- The same size and scope rules apply. An agent can write 2000 lines in an hour, and nobody can
review that in an hour. Split it.

Agents working in this repository read [`AGENTS.md`](AGENTS.md) (and Claude Code also reads
[`CLAUDE.md`](CLAUDE.md)), which put these rules into instructions for them.
Loading
Loading