Tests: a conformance title checks the runtime against the public platform documentation #2055

Open
0xkn0wh3r3 wants to merge 5 commits from upstream-pr/2057 into main
0xkn0wh3r3 commented 2026-11-25 04:14:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T04:14:37Z.


The problem

VIctory is checked by unit tests inside each crate and by runs of the title. Nothing checks the runtime's platform APIs end to end, the way a title calls them, without a title, game data or the SDK. So a call that answers differently from what the public platform documentation says goes unnoticed until a title trips on it.

The fix

This adds an acceptance layer that needs no title, no game data and no SDK: a conformance title. It is a stand-in Xbox title written from the public platform documentation only, run through VIctory's own loader and runtime (HleResolver). It calls each platform area as a title does and checks what the documentation says the call does. How to run it and what KNOWN means are in the test's module docs.

  • tests/fixtures/conformance: the title (a cdylib outside the workspace, like hle-probe); reports TAP.
  • crates/victory-hle/tests/conformance.rs: builds it, binds it, mounts G:/T: and storage as victory run does, runs it.

No SDK is used: the title links no SDK library and includes no SDK header. Area ids and method slots are VIctory's own, so the binary interface itself is only checked by the title. Behaviour, constants and layouts come from the public pages, cited per test.

Coverage: 152 checks, 147 pass

  • Runtime init and QueryApiImpl.
  • Task queues and async calls: dispatch modes and ports, delayed submits, terminate, XAsyncRun, provider op order, cancel, serialized and composite queues, identity mismatch, no process queue.
  • System info.
  • Physical pages aliased at two addresses.
  • DirectStorage from memory and files: raw, zlib, completion order, failed reads, request reuse, auto-submit.
  • Game saves: names, 16 MB limit, all-or-nothing.
  • The user: silent add, handles, ids, gamertag sizes and errors.
  • Networking hints and port; package; HDR.
  • Files on G:/T: through every path import VIctory binds.
  • Persistent local storage.

Five answers differ from the documentation

They are listed in the test (KNOWN) with why, and reported rather than failed. One of them passing fails the test, so the list stays true.

Check Documentation VIctory
XSystemGetConsoleId on retail 00000000.00000000.00000000.00000000.00 38 digits ending in 1
DirectStorage auto-submit an Enqueue filling more than half the capacity at half
XUserFindUserByLocalId, no such user HRESULT_FROM_WIN32(ERROR_NOT_FOUND) E_GAMEUSER_USER_NOT_FOUND
XUserGetGamertag, invalid component E_INVALIDARG the gamertag
async call, no queue, process queue nullptr E_NO_TASK_QUEUE runs the call

-- --ignored runs a streaming workload (DirectStorage memory sources; file sources and BCPack to come).

Testing

  • cargo test -p victory-hle --test conformance (Windows 11, RTX 5070 Ti): passes, 152 checks, 5 known divergences.
  • cargo clippy -p victory-hle --tests and clippy on the fixture: clean. Asset policy: ok.

#505 (a Wine harness for loader-level checks). This one checks runtime API behaviour against the documentation and runs under cargo test.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6597065341 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2057). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-25T04:14:37Z. --- ## The problem VIctory is checked by unit tests inside each crate and by runs of the title. Nothing checks the runtime's platform APIs end to end, the way a title calls them, without a title, game data or the SDK. So a call that answers differently from what the public platform documentation says goes unnoticed until a title trips on it. ## The fix This adds an acceptance layer that needs no title, no game data and no SDK: a **conformance title**. It is a stand-in Xbox title written from the public platform documentation only, run through VIctory's own loader and runtime (`HleResolver`). It calls each platform area as a title does and checks what the documentation says the call does. How to run it and what `KNOWN` means are in the test's module docs. - `tests/fixtures/conformance`: the title (a cdylib outside the workspace, like `hle-probe`); reports TAP. - `crates/victory-hle/tests/conformance.rs`: builds it, binds it, mounts `G:`/`T:` and storage as `victory run` does, runs it. No SDK is used: the title links no SDK library and includes no SDK header. Area ids and method slots are VIctory's own, so the binary interface itself is only checked by the title. Behaviour, constants and layouts come from the public pages, cited per test. ### Coverage: 152 checks, 147 pass - Runtime init and `QueryApiImpl`. - Task queues and async calls: dispatch modes and ports, delayed submits, terminate, `XAsyncRun`, provider op order, cancel, serialized and composite queues, identity mismatch, no process queue. - System info. - Physical pages aliased at two addresses. - DirectStorage from memory and files: raw, zlib, completion order, failed reads, request reuse, auto-submit. - Game saves: names, 16 MB limit, all-or-nothing. - The user: silent add, handles, ids, gamertag sizes and errors. - Networking hints and port; package; HDR. - Files on `G:`/`T:` through every path import VIctory binds. - Persistent local storage. ### Five answers differ from the documentation They are listed in the test (`KNOWN`) with why, and reported rather than failed. One of them passing fails the test, so the list stays true. | Check | Documentation | VIctory | |---|---|---| | `XSystemGetConsoleId` on retail | `00000000.00000000.00000000.00000000.00` | 38 digits ending in 1 | | DirectStorage auto-submit | an Enqueue filling more than half the capacity | at half | | `XUserFindUserByLocalId`, no such user | `HRESULT_FROM_WIN32(ERROR_NOT_FOUND)` | `E_GAMEUSER_USER_NOT_FOUND` | | `XUserGetGamertag`, invalid component | `E_INVALIDARG` | the gamertag | | async call, no queue, process queue nullptr | `E_NO_TASK_QUEUE` | runs the call | `-- --ignored` runs a streaming workload (DirectStorage memory sources; file sources and BCPack to come). ## Testing - `cargo test -p victory-hle --test conformance` (Windows 11, RTX 5070 Ti): passes, 152 checks, 5 known divergences. - `cargo clippy -p victory-hle --tests` and clippy on the fixture: clean. Asset policy: ok. ## Related #505 (a Wine harness for loader-level checks). This one checks runtime API behaviour against the documentation and runs under `cargo test`.
catminou4 commented 2026-11-25 05:05:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T04:17:37Z.

Review: COMMENTED


Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff.

Conformance title checks the runtime against the public GDK — docs+hle test infrastructure for GDK conformance; valuable if it runs in CI.

<!-- greyfinch-sync:Marvisak/VIctory:review:6051789862 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2057#pullrequestreview-6051789862). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T04:17:37Z. **Review:** COMMENTED --- Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff. Conformance title checks the runtime against the public GDK — docs+hle test infrastructure for GDK conformance; valuable if it runs in CI.
Dathinel commented 2026-11-25 05:06:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-25T04:17:17Z.


The harness catches a known divergence turning green, but it also goes green if that check disappears entirely. This can happen with a well-formed report: the fixture computes its TAP plan from the checks it actually emits, so dropping a call lowers the plan too.

I tested the unchanged acceptance function and KNOWN at 637ba6f9, using the PR's Tap writer and replacing only call() with synthetic reports:

Input to the acceptance function Observed
One ordinary pass + all five known failures Pass
One known failure becomes a pass Fail
An additional, unknown failure Fail
Omit one known check; writer emits a matching 1..5 plan Pass
Keep the 1..6 plan but return only the first passing result Pass

Could the acceptance test require every unconditional KNOWN name to appear exactly once, and check the parsed result count against the TAP plan? The first catches a silently removed check; the second catches a partial transcript. Neither requires pinning the suite to 152 checks.

This tests the report consumer in isolation. I have no evidence that the reported title run skipped a check. AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152704986 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2057#issuecomment-7152704986). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-25T04:17:17Z. --- The harness catches a known divergence turning green, but it also goes green if that check disappears entirely. This can happen with a well-formed report: the fixture computes its TAP plan from the checks it actually emits, so dropping a call lowers the plan too. I tested the unchanged acceptance function and `KNOWN` at `637ba6f9`, using the PR's `Tap` writer and replacing only `call()` with synthetic reports: | Input to the acceptance function | Observed | |---|---| | One ordinary pass + all five known failures | Pass | | One known failure becomes a pass | Fail | | An additional, unknown failure | Fail | | Omit one known check; writer emits a matching `1..5` plan | **Pass** | | Keep the `1..6` plan but return only the first passing result | **Pass** | Could the acceptance test require every unconditional `KNOWN` name to appear exactly once, and check the parsed result count against the TAP plan? The first catches a silently removed check; the second catches a partial transcript. Neither requires pinning the suite to 152 checks. This tests the report consumer in isolation. I have no evidence that the reported title run skipped a check. AI-assisted.
Dathinel commented 2026-11-25 05:06:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-25T04:29:54Z.


Integration result: all 152 checks pass with the five runtime fixes together. I ran the conformance title on Windows build 26200 with Rust 1.98.1 MSVC against #2057 at 637ba6f9. The baseline emitted 147 passes and the five listed divergences.

I also applied each fix individually on that same baseline. Every run emitted the same 152 numbered check names. Exactly one result changed per PR:

Runtime patch Check that changed from failing to passing
#2072 34fe6703 113 — invalid gamertag component
#2073 3dd083a3 102 — unknown local user ID
#2074 2ced7715 80 — queue exactly half full
#2075 7f533796 49 — no supplied or process task queue
#1717 35fb57d4 55 — retail console ID

Stacking #2072 through #2075 produced 151/152, with only the console ID still failing. Adding #1717 produced 152/152. The stacked patches applied cleanly. I retained the fixture assertions throughout and removed only the corresponding entries from the host test's KNOWN list. Leaving that list unchanged in the four-fix stack correctly made the host test fail on the newly passing checks.

Command: cargo test --frozen -p victory-hle --test conformance the_conformance_title_runs_through_victory -- --nocapture. This used the synthetic title through the loader and runtime; the streaming benchmark was outside this run. AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152896231 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2057#issuecomment-7152896231). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-25T04:29:54Z. --- **Integration result: all 152 checks pass with the five runtime fixes together.** I ran the conformance title on Windows build 26200 with Rust 1.98.1 MSVC against #2057 at `637ba6f9`. The baseline emitted 147 passes and the five listed divergences. I also applied each fix **individually** on that same baseline. Every run emitted the same 152 numbered check names. Exactly one result changed per PR: | Runtime patch | Check that changed from failing to passing | |---|---| | #2072 `34fe6703` | 113 — invalid gamertag component | | #2073 `3dd083a3` | 102 — unknown local user ID | | #2074 `2ced7715` | 80 — queue exactly half full | | #2075 `7f533796` | 49 — no supplied or process task queue | | #1717 `35fb57d4` | 55 — retail console ID | Stacking #2072 through #2075 produced **151/152**, with only the console ID still failing. Adding #1717 produced **152/152**. The stacked patches applied cleanly. I retained the fixture assertions throughout and removed only the corresponding entries from the host test's `KNOWN` list. Leaving that list unchanged in the four-fix stack correctly made the host test fail on the newly passing checks. Command: `cargo test --frozen -p victory-hle --test conformance the_conformance_title_runs_through_victory -- --nocapture`. This used the synthetic title through the loader and runtime; the streaming benchmark was outside this run. AI-assisted.
0xkn0wh3r3 commented 2026-11-25 07:03:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T06:22:36Z.


Thanks @Dathinel, both holes were real, and thanks for the integration run across the five fixes.

d594a73 makes the report check strict. accept now requires:

  • results numbered 1 to the plan's count, in order, so a report cut short of its plan fails;
  • each KNOWN check to appear exactly once and still fail, so a check that disappears fails even when the plan was lowered to match;
  • nothing else to fail, as before.

It doesn't pin the total at 152. The new reports_missing_or_cut_short_checks_are_refused runs it on made-up reports covering your table and a few more cases: all present, a skipped check, a known check removed with the plan lowered, a report cut short, a known divergence that now passes, an unknown failure, a known check listed twice, and no checks at all. The title's real run still passes.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7154726787 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2057#issuecomment-7154726787). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-25T06:22:36Z. --- Thanks @Dathinel, both holes were real, and thanks for the integration run across the five fixes. `d594a73` makes the report check strict. `accept` now requires: - results numbered 1 to the plan's count, in order, so a report cut short of its plan fails; - each `KNOWN` check to appear exactly once and still fail, so a check that disappears fails even when the plan was lowered to match; - nothing else to fail, as before. It doesn't pin the total at 152. The new `reports_missing_or_cut_short_checks_are_refused` runs it on made-up reports covering your table and a few more cases: all present, a skipped check, a known check removed with the plan lowered, a report cut short, a known divergence that now passes, an unknown failure, a known check listed twice, and no checks at all. The title's real run still passes.
Marvisak commented 2026-11-25 10:07:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T09:23:47Z.


Automated triage for the maintainers.

Needs work: needs the maintainer's decision. The content side is still in order on this head: the PR title no longer names the SDK, and a grep of the diff finds only generic "no SDK" mentions and the public Windows header fileapi.h. The run notes and the meaning of KNOWN are short module docs in crates/victory-hle/tests/conformance.rs. The branch merges cleanly into current main.

Only the maintainer can decide on:

  • tests/fixtures/conformance/Cargo.toml and its own Cargo.lock. The lock holds only miniz_oxide 0.9.1 and adler2 2.0.1, which the workspace already uses.
  • build_fixture, which runs Command::new(env!("CARGO")) to build the fixture, the same pattern crates/victory-loader/tests/load_probe.rs uses for hle-probe.

Coordination still applies: #2072 to #2075 and #1717 each turn one KNOWN entry into a pass, so whichever lands second must edit the list.

On your reply: thanks for the title fix. Nothing more is needed from you until the maintainer decides.

CI: passing (check).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158272802 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2057#issuecomment-7158272802). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T09:23:47Z. --- <!-- victory-triage v1 head=1434e7254d6d27ecd046e2e60290897497409b8a verdict=needs-work at=2026-11-26T00:26:15Z --> Automated triage for the maintainers. **Needs work: needs the maintainer's decision.** The content side is still in order on this head: the PR title no longer names the SDK, and a grep of the diff finds only generic "no SDK" mentions and the public Windows header `fileapi.h`. The run notes and the meaning of `KNOWN` are short module docs in `crates/victory-hle/tests/conformance.rs`. The branch merges cleanly into current `main`. Only the maintainer can decide on: - `tests/fixtures/conformance/Cargo.toml` and its own `Cargo.lock`. The lock holds only `miniz_oxide` 0.9.1 and `adler2` 2.0.1, which the workspace already uses. - `build_fixture`, which runs `Command::new(env!("CARGO"))` to build the fixture, the same pattern `crates/victory-loader/tests/load_probe.rs` uses for `hle-probe`. Coordination still applies: #2072 to #2075 and #1717 each turn one `KNOWN` entry into a pass, so whichever lands second must edit the list. On your reply: thanks for the title fix. Nothing more is needed from you until the maintainer decides. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
0xkn0wh3r3 commented 2026-11-25 19:06:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T18:37:42Z.


Thanks, done in c4785e8:

  • Naming the SDK: it's gone from the code, the fixture's manifest and the description. Everything now cites the public platform documentation. The console error codes used (E_NO_TASK_QUEUE, E_GS_INVALID_CONTAINER_NAME, E_GS_UPDATE_TOO_BIG, E_GAMEUSER_USER_NOT_FOUND) are all on the public error-codes page with these values. The rest are standard Win32 codes.

  • Short docs: docs/acceptance.md is deleted. The command to run the suite, and what KNOWN means, are now a few lines in conformance.rs's module docs: a known divergence is reported, not failed, and one that starts passing fails the test.

  • For your decision:

    • miniz_oxide isn't new to the project. It's the same 0.9.1 the workspace already uses: victory-hle inflates DirectStorage zlib requests with it. The fixture only compresses test data with it. Without it the data would have to be stored blocks, which never touch the Huffman decoding the zlib checks are there to test.
    • The cargo spawn builds the fixture into CARGO_TARGET_TMPDIR, because the outer cargo holds the main target dir's lock. A build.rs building a cdylib would avoid the spawn, at the cost of a bigger change.

    I'm happy to change either if you'd rather.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171171442 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2057#issuecomment-7171171442). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-25T18:37:42Z. --- Thanks, done in c4785e8: - **Naming the SDK:** it's gone from the code, the fixture's manifest and the description. Everything now cites the public platform documentation. The console error codes used (`E_NO_TASK_QUEUE`, `E_GS_INVALID_CONTAINER_NAME`, `E_GS_UPDATE_TOO_BIG`, `E_GAMEUSER_USER_NOT_FOUND`) are all on the public error-codes page with these values. The rest are standard Win32 codes. - **Short docs:** `docs/acceptance.md` is deleted. The command to run the suite, and what `KNOWN` means, are now a few lines in `conformance.rs`'s module docs: a known divergence is reported, not failed, and one that starts passing fails the test. - **For your decision:** - `miniz_oxide` isn't new to the project. It's the same 0.9.1 the workspace already uses: victory-hle inflates DirectStorage zlib requests with it. The fixture only compresses test data with it. Without it the data would have to be stored blocks, which never touch the Huffman decoding the zlib checks are there to test. - The cargo spawn builds the fixture into `CARGO_TARGET_TMPDIR`, because the outer cargo holds the main target dir's lock. A `build.rs` building a cdylib would avoid the spawn, at the cost of a bigger change. I'm happy to change either if you'd rather.
upstream-sync changed title from [PR #2057] Tests: a conformance title checks the runtime against the public GDK reference to [PR #2057] Tests: a conformance title checks the runtime against the public platform documentation 2026-11-26 00:01:37 +00:00
0xkn0wh3r3 commented 2026-11-26 00:03:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T00:00:37Z.


Thanks for re-checking. One more rule 2 fix: the PR title still named the SDK, and now reads "…against the public platform documentation". The fixture crate and the cargo build spawn are left for your decision. Both follow the pattern load_probe.rs already uses for hle-probe.

On the KNOWN list: agreed, whichever of #2072–#2075 and #1717 lands after this removes its entry, and I'll do that edit for the ones of mine. The branch is rebased onto current main with CI green.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7178295715 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2057#issuecomment-7178295715). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-26T00:00:37Z. --- Thanks for re-checking. One more rule 2 fix: the PR title still named the SDK, and now reads "…against the public platform documentation". The fixture crate and the `cargo build` spawn are left for your decision. Both follow the pattern `load_probe.rs` already uses for `hle-probe`. On the `KNOWN` list: agreed, whichever of #2072–#2075 and #1717 lands after this removes its entry, and I'll do that edit for the ones of mine. The branch is rebased onto current `main` with CI green.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2057:upstream-pr/2057'
git switch 'upstream-pr/2057'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2057'
git switch 'upstream-pr/2057'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2057'
git switch 'upstream-pr/2057'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2057'
git switch 'main'
git merge --squash 'upstream-pr/2057'
git switch 'main'
git merge --ff-only 'upstream-pr/2057'
git switch 'main'
git merge 'upstream-pr/2057'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!2055
No description provided.