XGameRuntime: one reading of the title id for both APIs and the start-up line #1851

Open
github-bot wants to merge 1 commit from github-bot/gh-1851 into main AGit
Owner

@⁠us3r40456 on GitHub · 2026-11-24 21:48 UTC · original
us3r40456:titleid-one-reading → main · +64 −5 · 2 files · 1 commits · draft

XCL gives a title its title id through two XGameRuntime functions, and they read title_id in two ways. XGameGetXboxTitleId parses it as hex after stripping a lowercase 0x, and gives 0 for anything else. XPackageEnumeratePackages hands over the raw text, upper-cased. So a malformed id reaches the title as 0 from one and as text from the other (XYZ123 → 0 and "XYZ123"). The start-up line also prints the manifest's value as if it were taken, and the warning says "no TitleId" when there is one it cannot read. This PR gives both functions and the start-up line one reading.

What is in it

  • config::parse_title_id: hex, with or without 0x / 0X, spaces around it ignored. Empty, not hex (a + sign included), wider than 32 bits or 0 is no title id. Config::title_id_value applies it to title_id.
  • XGameGetXboxTitleId uses it. The warning stays "no TitleId …" when there is none, and names the value when there is one it cannot read (TitleId "XYZ123" (MicrosoftGame.Config / xcl.toml) is not a nonzero 32-bit hex title id → 0).
  • XPackageEnumeratePackages's title_id is that number as 8 hex digits, or empty where XGameGetXboxTitleId gives 0.
  • The start-up line marks a manifest id that is not one: TitleId "XYZ123" (not a nonzero 32-bit hex title id: the title gets none).
  • Test a_title_id_is_read_one_way: the parser on 12 inputs, the start-up line for a good and a bad id, and that xcl.toml's id wins over the manifest's.
  • Unchanged on purpose: the XSystemGetAppSpecificDeviceId hash (api.rs:1265) still uses the title_id text, so the id it gives a title does not change for anyone.

Tested

  • MacBook Pro, Apple M5 Pro (20-core GPU), 24 GB, macOS 27.2.1, Rosetta 2. CrossOver 26.3.0.39832 with D3DMetal 3.0. Cross-built with cargo-xwin 0.24.1 (Rust 1.100.0, clang-cl / lld 23.1.6), DXC 1.9.2609.
  • lib unit tests, debug, one at a time, at this PR's head on main 1d027e5: config:: 8 passed, hle::xgameruntime:: 73 passed, 0 failed.
  • The e2e test title (release), with a local probe that calls both functions the way a GDK title does (QueryApiImpl, XGame slot 3 and XPackage slot 39), with 13 variants (12 before the change) of its MicrosoftGame.config <TitleId> and of title_id in xcl.toml. Each variant was run before the change, on the Mac test stack (main 7f7e768 + #750 + #1329 + #1813 + pr/native-host-vtables, which takes the title to its end on a Mac), and after it, on main 1d027e5 + this PR. Three of them (XYZ123, 0X1234ABCD, 1234ABCD) were also run on plain main 1d027e5, with the same values as on the stack:
<TitleId> / xcl.toml main: slot 3 / slot 39 this PR: slot 3 / slot 39
none 0 / "" 0 / ""
1234ABCD, 0x1234abcd, with spaces and line breaks 0x1234abcd / "1234ABCD" the same
0X1234ABCD 0 / "0X1234ABCD" 0x1234abcd / "1234ABCD"
XYZ123 0 / "XYZ123" 0 / ""
123456789 0 / "123456789" 0 / ""
empty 0 / "" 0 / ""
00000000 0 / "00000000" 0 / ""
ABCD 0x0000abcd / "ABCD" (read from the code, not run) 0x0000abcd / "0000ABCD"
xcl.toml CAFE0001 (manifest 1234ABCD) 0xcafe0001 / "CAFE0001" the same
xcl.toml pasunid 0 / "PASUNID" 0 / ""

The title id changes nothing else in the test title: on the stack every variant ends with the same 47 PASS / 3 FAIL, and on plain main with and without this PR every variant gets 31 PASS / 1 FAIL before plain main's known D3DMetal crash (#258), which comes after the probe. The probe is not part of this PR.

Regression run
This changes crates/xcl/src, so it needs xcl-smoke pairs. I have no title. A title with a valid hex <TitleId> gets the same values as before, except that XPackageEnumeratePackages now always writes 8 digits (ABCD → 0000ABCD). Draft until the pairs are here.

main:

PR:

Not tested

  • Windows and Linux / Wine. The change has no host-specific path.
  • Whether a GDK title expects 8 digits or the manifest's own spelling in XPackageDetails::titleId. I chose 8 digits, the way the console writes title ids. I have no title to check against.
  • The whole unit test suite; only config:: and hle::xgameruntime::.

AI use

  • Claude Code, Claude Opus 5.5 found the inconsistencies with the test runs, wrote the change, the test and this description, and ran the tests on this machine.
**@⁠us3r40456** on GitHub · 2026-11-24 21:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/1851) `us3r40456:titleid-one-reading` → `main` · +64 −5 · 2 files · 1 commits · draft XCL gives a title its title id through two XGameRuntime functions, and they read `title_id` in two ways. `XGameGetXboxTitleId` parses it as hex after stripping a lowercase `0x`, and gives 0 for anything else. `XPackageEnumeratePackages` hands over the raw text, upper-cased. So a malformed id reaches the title as 0 from one and as text from the other (`XYZ123` → 0 and `"XYZ123"`). The start-up line also prints the manifest's value as if it were taken, and the warning says "no TitleId" when there is one it cannot read. This PR gives both functions and the start-up line one reading. **What is in it** - `config::parse_title_id`: hex, with or without `0x` / `0X`, spaces around it ignored. Empty, not hex (a `+` sign included), wider than 32 bits or 0 is no title id. `Config::title_id_value` applies it to `title_id`. - `XGameGetXboxTitleId` uses it. The warning stays "no TitleId …" when there is none, and names the value when there is one it cannot read (`TitleId "XYZ123" (MicrosoftGame.Config / xcl.toml) is not a nonzero 32-bit hex title id → 0`). - `XPackageEnumeratePackages`'s `title_id` is that number as 8 hex digits, or empty where `XGameGetXboxTitleId` gives 0. - The start-up line marks a manifest id that is not one: `TitleId "XYZ123" (not a nonzero 32-bit hex title id: the title gets none)`. - Test `a_title_id_is_read_one_way`: the parser on 12 inputs, the start-up line for a good and a bad id, and that xcl.toml's id wins over the manifest's. - Unchanged on purpose: the `XSystemGetAppSpecificDeviceId` hash (`api.rs:1265`) still uses the `title_id` text, so the id it gives a title does not change for anyone. **Tested** - MacBook Pro, Apple M5 Pro (20-core GPU), 24 GB, macOS 27.2.1, Rosetta 2. CrossOver 26.3.0.39832 with D3DMetal 3.0. Cross-built with cargo-xwin 0.24.1 (Rust 1.100.0, clang-cl / lld 23.1.6), DXC 1.9.2609. - lib unit tests, debug, one at a time, at this PR's head on `main` `1d027e5`: `config::` 8 passed, `hle::xgameruntime::` 73 passed, 0 failed. - The e2e test title (release), with a local probe that calls both functions the way a GDK title does (`QueryApiImpl`, `XGame` slot 3 and `XPackage` slot 39), with 13 variants (12 before the change) of its `MicrosoftGame.config` `<TitleId>` and of `title_id` in `xcl.toml`. Each variant was run before the change, on the Mac test stack (`main` `7f7e768` + #750 + #1329 + #1813 + `pr/native-host-vtables`, which takes the title to its end on a Mac), and after it, on `main` `1d027e5` + this PR. Three of them (`XYZ123`, `0X1234ABCD`, `1234ABCD`) were also run on plain `main` `1d027e5`, with the same values as on the stack: | `<TitleId>` / xcl.toml | `main`: slot 3 / slot 39 | this PR: slot 3 / slot 39 | |---|---|---| | none | 0 / `""` | 0 / `""` | | `1234ABCD`, `0x1234abcd`, with spaces and line breaks | `0x1234abcd` / `"1234ABCD"` | the same | | `0X1234ABCD` | **0** / `"0X1234ABCD"` | `0x1234abcd` / `"1234ABCD"` | | `XYZ123` | 0 / **`"XYZ123"`** | 0 / `""` | | `123456789` | 0 / **`"123456789"`** | 0 / `""` | | empty | 0 / `""` | 0 / `""` | | `00000000` | 0 / **`"00000000"`** | 0 / `""` | | `ABCD` | `0x0000abcd` / `"ABCD"` (read from the code, not run) | `0x0000abcd` / `"0000ABCD"` | | xcl.toml `CAFE0001` (manifest `1234ABCD`) | `0xcafe0001` / `"CAFE0001"` | the same | | xcl.toml `pasunid` | 0 / **`"PASUNID"`** | 0 / `""` | The title id changes nothing else in the test title: on the stack every variant ends with the same 47 PASS / 3 FAIL, and on plain `main` with and without this PR every variant gets 31 PASS / 1 FAIL before plain `main`'s known D3DMetal crash (#258), which comes after the probe. The probe is not part of this PR. **Regression run** This changes `crates/xcl/src`, so it needs `xcl-smoke` pairs. I have no title. A title with a valid hex `<TitleId>` gets the same values as before, except that `XPackageEnumeratePackages` now always writes 8 digits (`ABCD` → `0000ABCD`). Draft until the pairs are here. main: PR: **Not tested** - Windows and Linux / Wine. The change has no host-specific path. - Whether a GDK title expects 8 digits or the manifest's own spelling in `XPackageDetails::titleId`. I chose 8 digits, the way the console writes title ids. I have no title to check against. - The whole unit test suite; only `config::` and `hle::xgameruntime::`. **AI use** - Claude Code, Claude Opus 5.5 found the inconsistencies with the test runs, wrote the change, the test and this description, and ran the tests on this machine.
XGameGetXboxTitleId parsed title_id as hex after stripping a lowercase
"0x" and gave 0 for anything else, while XPackageEnumeratePackages handed
the title the raw text, upper-cased. A malformed id therefore reached the
title as 0 from one API and as text from the other, the start-up line
showed it as if it were taken, and the warning said there was no TitleId.

config::parse_title_id is now the one reading: hex, "0x" or "0X", spaces
around ignored; empty, not hex, wider than 32 bits or 0 is no title id.
XGameGetXboxTitleId and XPackageEnumeratePackages (8 hex digits, or none)
both use it, the start-up line marks an id that is not one, and the
warning names the value it could not read.

Test: a_title_id_is_read_one_way.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:07:15 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 01:28 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-25 01:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1851#issuecomment-7149591136) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/config.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1851/head:github-bot/gh-1851'
git switch 'github-bot/gh-1851'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1851'
git switch 'github-bot/gh-1851'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1851'
git switch 'github-bot/gh-1851'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1851'
git switch 'main'
git merge --squash 'github-bot/gh-1851'
git switch 'main'
git merge --ff-only 'github-bot/gh-1851'
git switch 'main'
git merge 'github-bot/gh-1851'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.