TOOL-BOOT-MATRIX: tools/boot_matrix.py, how far the retail boot gets for each set of pull requests #569

Open
github-bot wants to merge 9 commits from github-bot/gh-569 into main AGit
Owner

@⁠CLHelper on GitHub · 2026-11-24 08:34 UTC · original
CLHelper:tools/boot-matrix → main · +1379 −1 · 3 files · 9 commits · open

Claimed in the coordination issue as: TOOL-BOOT-MATRIX (#14)

What and why

Boot work is spread over many open pull requests at once (the slot 73 CreateCommandListX IID, the window class, the
next device slots), and the stop someone reports depends on which of them were merged, in which order, onto which
main, and whether their shader library came from the same translator. This tool makes that explicit, one row per
named set:

  • merge combines each set onto a base with git merge-tree --write-tree and git commit-tree: no checkout, no
    hooks, nothing from a pull request runs. A PR that scripts/merge_check.py finds already on the base is skipped;
    one that conflicts is skipped with its files listed, saying whether it conflicts with the base or with an earlier PR
    in the set. Each set becomes the branch boot-matrix/<set>; an empty set (main=) is the base alone.
  • run builds runtime/ in a set's tree (exported where you build PR code) or takes --gta6rt, runs
    --run --trace --trace-d3d12 with LEONIDA_D3D12=vulkan, stops the process tree at --timeout, and writes
    result.json (the stop, the D3D12 call count and last call, and whether the shader library's
    translation_sources.sha256 matches the tree). Each run gets a fresh overlay and save folder.
  • report prints a Markdown table of the newest run of each set's current head, ready to paste into an issue. Traces
    stay on your machine; failed file paths and debug strings are left out of the report.

docs/boot.md gets a section on it. Standard library only; git 2.38 or newer for merge-tree --write-tree.

It was written and reviewed in the original repository before that went private; this is the same code on current
main, with the examples naming pull requests of this repository.

Tested

  • python -I tests/test_boot_matrix.py: 21 tests pass on Windows 11 (Python 3.13, git 2.53), on this branch's
    main. They build throwaway repositories with git and fake gta6rt runs; no game files.
  • python -I -m compileall over the tool and the test; python -I tools/boot_matrix.py --help.
  • run against the retail executable was not part of this test.

GPUs tested: n/a (no GPU code; run uses whatever gta6rt the set builds)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)
**@⁠CLHelper** on GitHub · 2026-11-24 08:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/569) `CLHelper:tools/boot-matrix` → `main` · +1379 −1 · 3 files · 9 commits · open Claimed in the coordination issue as: TOOL-BOOT-MATRIX (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why Boot work is spread over many open pull requests at once (the slot 73 `CreateCommandListX` IID, the window class, the next device slots), and the stop someone reports depends on which of them were merged, in which order, onto which `main`, and whether their shader library came from the same translator. This tool makes that explicit, one row per named set: - `merge` combines each set onto a base with `git merge-tree --write-tree` and `git commit-tree`: no checkout, no hooks, nothing from a pull request runs. A PR that `scripts/merge_check.py` finds already on the base is skipped; one that conflicts is skipped with its files listed, saying whether it conflicts with the base or with an earlier PR in the set. Each set becomes the branch `boot-matrix/<set>`; an empty set (`main=`) is the base alone. - `run` builds `runtime/` in a set's tree (exported where you build PR code) or takes `--gta6rt`, runs `--run --trace --trace-d3d12` with `LEONIDA_D3D12=vulkan`, stops the process tree at `--timeout`, and writes `result.json` (the stop, the D3D12 call count and last call, and whether the shader library's `translation_sources.sha256` matches the tree). Each run gets a fresh overlay and save folder. - `report` prints a Markdown table of the newest run of each set's current head, ready to paste into an issue. Traces stay on your machine; failed file paths and debug strings are left out of the report. `docs/boot.md` gets a section on it. Standard library only; git 2.38 or newer for `merge-tree --write-tree`. It was written and reviewed in the original repository before that went private; this is the same code on current `main`, with the examples naming pull requests of this repository. ### Tested - `python -I tests/test_boot_matrix.py`: 21 tests pass on Windows 11 (Python 3.13, git 2.53), on this branch's `main`. They build throwaway repositories with git and fake `gta6rt` runs; no game files. - `python -I -m compileall` over the tool and the test; `python -I tools/boot_matrix.py --help`. - `run` against the retail executable was not part of this test. GPUs tested: n/a (no GPU code; `run` uses whatever `gta6rt` the set builds) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change)
merge: each set is merged onto the base in order with git merge-tree/commit-tree (no checkout,
nothing from a PR runs); PRs merge_check.py finds already on the base, and PRs that conflict with
an earlier one in the set, are skipped and listed. One branch boot-matrix/<set> per set, plus
matrix.json with the translator digest of each head.

run: builds runtime/ in the set's tree (or takes --gta6rt), runs gta6rt --run --trace
--trace-d3d12 with LEONIDA_D3D12=vulkan and a timeout that stops the process tree, summarises the
traces with boot_trace.py and says whether the shader library came from this tree's translator.

report: the newest run of each set as a Markdown table (counts, RVAs and method names only).
(cherry picked from commit a00525cd2f3aadc3a63a1023a5926c315d767416)
(cherry picked from commit 97fa0445b2c053f522396e48f70948a19320230c)
(cherry picked from commit 8acdec1445f6c51e8eef1c22297c6f2c36034149)
(cherry picked from commit 59502aecca5bf43515302f779a6ff67630255083)
(cherry picked from commit af684001388452f44c47666e606d4927d657a53b)
(cherry picked from commit 6e6efcb4e236ed9a6d85e4f2a072d6b53c172586)
(cherry picked from commit 810d5bb667ec29ed8e6b3281f0188270bde61172)
(cherry picked from commit 4aa326318b5b24eedd1abd54531916b079cd6ee3)
The examples used numbers from the original repository, which link nowhere now (CONTRIBUTING.md).
merge writes the blob id of every file of each set's head to <set>/files.json; run
stops (exit 2) before building when the tree lacks one of them or holds other content
(CRLF line ends aside; files the head does not have are ignored). A --gta6rt run is
recorded as built 'prebuilt (unverified)'.

report (Markdown and --json) passes on a fixed list of fields: no access address, no
loader message and no D3D12 call arguments; those stay in each run's result.json.
shims::module_offset gives a bare absolute address when the instruction pointer is in
no known module; report and report --json passed it on. A shared location is now
module+RVA (or host:<dll>+RVA, a file name, never a path) or 'unmapped'; result.json
keeps the original. Tests: a crash at a bare address through both report commands,
and the site rule itself. Docstring lines rewrapped to the 120-column limit.
The report cut the last D3D12 call to its first word to drop argument text, but the
runtime writes fixed labels without arguments (d3d12_trace.h), some with spaces:
'Xbox CreatePlacedResourceX (device slot 133)' became 'Xbox'. A label of the shape the
runtime writes (one or two identifier words, optional '(device slot N)', checked
against all 43 labels of three world-start runs) is now shown whole; other text is
still cut to its first word. Tests: real labels kept, argument- and path-like text cut,
the last call of a slot label.
From an independent read before the next review round:
- report and report --json: the call's outcome must be one the runtime writes, an
  exception code hex or an exit code a number, the access kind read/write/execute,
  else 'other'; a label with free text keeps its name, anything else is '(other)'.
- The base shows as its commit only, PR rows as number, status and skip reason; the
  refs given (N:REF can name a local branch), merge_check verdicts and conflicted
  file names stay in matrix.json.
- run --build builds in runtime/build-boot-matrix-<head>: an export of another set
  over the same tree keeps old file dates, so a shared build folder handed back the
  earlier set's binary.
- merge: a checked-out set branch stops the merge before anything is written;
  Windows device names are refused as set names. A PR merged and then reverted on
  the base stays 'already-merged' (git merges an ancestor as a no-op); documented.
- result.json records the run's options (--env names, timeout, overlay, config).
- Docs and docstring say what the code does (overlay, exit code 1 on a failed build).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:09:04 +00:00
Author
Owner

@⁠sodove on GitHub · 2026-11-24 08:40 UTC · original

Independent Windows check of f241156 with Python 3.12 and Git 2.39.1. The 21 stock tests passed. A throwaway repository and two CMake-built stand-ins for the runtime reproduced two reporting issues.

  1. A run can be attributed to the wrong set. With the base checkout still active, run --set with-pr --build built and ran the base, then filed the result under the merged head as if its PR had been tested. The translator digest was identical for both commits because the PR changed only the runtime. A build after checking out the merged branch returned the other, expected exit class. Passing the base executable via --gta6rt while on the merged checkout reproduced the misattribution. Please verify the source HEAD for checkout builds and mark exports and prebuilt binaries as unverified unless their provenance can be checked.
  2. Both report formats copy raw trace fields. With synthetic startup and D3D12 events, the Markdown and JSON reports both copied the loader message (including its path), exception location/address and D3D12 detail text. These can carry inputs or local data even when the underlying trace files stay local. Please make the shareable report emit counts, stable error classes and method names, keeping raw detail in the local result. The Markdown warning covers the loader message, while the PR description calls the table ready to paste.

All probes used synthetic inputs. AI-assisted.

**@⁠sodove** on GitHub · 2026-11-24 08:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7126429638) Independent Windows check of `f241156` with Python 3.12 and Git 2.39.1. The 21 stock tests passed. A throwaway repository and two CMake-built stand-ins for the runtime reproduced two reporting issues. 1. **A run can be attributed to the wrong set.** With the base checkout still active, `run --set with-pr --build` built and ran the base, then filed the result under the merged head as if its PR had been tested. The translator digest was identical for both commits because the PR changed only the runtime. A build after checking out the merged branch returned the other, expected exit class. Passing the base executable via `--gta6rt` while on the merged checkout reproduced the misattribution. Please verify the source HEAD for checkout builds and mark exports and prebuilt binaries as unverified unless their provenance can be checked. 2. **Both report formats copy raw trace fields.** With synthetic startup and D3D12 events, the Markdown and JSON reports both copied the loader message (including its path), exception location/address and D3D12 detail text. These can carry inputs or local data even when the underlying trace files stay local. Please make the shareable report emit counts, stable error classes and method names, keeping raw detail in the local result. The Markdown warning covers the loader message, while the PR description calls the table ready to paste. All probes used synthetic inputs. AI-assisted.
Author
Owner

@⁠CLHelper on GitHub · 2026-11-25 08:27 UTC · original

@⁠sodove thanks, both points were right; fixed in 589b52dbb, and the branch is rebased onto current main (3f81d46ac).

  1. run now checks the tree before it builds anything: merge writes the blob id of every file of the set's head to <matrix>/<set>/files.json, and a tree (checkout or export) that lacks one of those files or holds other content stops the run with exit 2, naming the files. CRLF line ends count as the same file; files the head does not have (a build folder) are ignored. A --gta6rt binary is recorded and reported as prebuilt (unverified).
  2. report, Markdown and --json, now passes on only a fixed list of fields: the stop's kind, exception code, module+RVA and access kind, the counts, and the last D3D12 call as number, method and result. The access address, the loader's message and the call's arguments stay in each run's local result.json. The "ready to paste" wording is gone; docs/boot.md says the same.

New tests: a checkout at another commit, a locally edited file and an export missing a file are refused; a CRLF export with a build folder runs; a report has no address and no call arguments; a loader message stays out of the table. 27/27 pass locally, and each new check fails when the code it covers is removed. AI-assisted.

**@⁠CLHelper** on GitHub · 2026-11-25 08:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7157055944) @⁠sodove thanks, both points were right; fixed in 589b52dbb, and the branch is rebased onto current `main` (3f81d46ac). 1. `run` now checks the tree before it builds anything: `merge` writes the blob id of every file of the set's head to `<matrix>/<set>/files.json`, and a tree (checkout or export) that lacks one of those files or holds other content stops the run with exit 2, naming the files. CRLF line ends count as the same file; files the head does not have (a build folder) are ignored. A `--gta6rt` binary is recorded and reported as `prebuilt (unverified)`. 2. `report`, Markdown and `--json`, now passes on only a fixed list of fields: the stop's kind, exception code, module+RVA and access kind, the counts, and the last D3D12 call as number, method and result. The access address, the loader's message and the call's arguments stay in each run's local `result.json`. The "ready to paste" wording is gone; `docs/boot.md` says the same. New tests: a checkout at another commit, a locally edited file and an export missing a file are refused; a CRLF export with a build folder runs; a report has no address and no call arguments; a loader message stays out of the table. 27/27 pass locally, and each new check fails when the code it covers is removed. AI-assisted.
Author
Owner

@⁠sodove on GitHub · 2026-11-25 08:38 UTC · original

Retested 589b52dbb on native Windows with Python 3.12. All 27 stock tests passed. The wrong-checkout case now stops before launch, and the report tests pass for the loader message, access address, and D3D12 call arguments.

One case remains in both report formats. When the instruction pointer falls outside every known module, shims::module_offset returns a bare absolute address (runtime/shims/registry.cpp:389). The exception trace uses that value for at, and shareable() forwards it unchanged. I changed only the synthetic fixture's exception location from module+RVA to a made-up bare address. After a run through the fixture, both report and report --json printed that address (2/2). Neither printed the D3D12 call arguments (0/2).

Could the shared report render this case as unmapped and keep the original location in local result.json? A regression test covering both report commands would catch it while preserving module-relative locations.

Synthetic inputs only, CPU only. AI-assisted: yes.

**@⁠sodove** on GitHub · 2026-11-25 08:38 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7157287267) Retested `589b52dbb` on native Windows with Python 3.12. All 27 stock tests passed. The wrong-checkout case now stops before launch, and the report tests pass for the loader message, access address, and D3D12 call arguments. One case remains in both report formats. When the instruction pointer falls outside every known module, `shims::module_offset` returns a bare absolute address (`runtime/shims/registry.cpp:389`). The exception trace uses that value for `at`, and `shareable()` forwards it unchanged. I changed only the synthetic fixture's exception location from module+RVA to a made-up bare address. After a run through the fixture, both `report` and `report --json` printed that address (2/2). Neither printed the D3D12 call arguments (0/2). Could the shared report render this case as `unmapped` and keep the original location in local `result.json`? A regression test covering both report commands would catch it while preserving module-relative locations. Synthetic inputs only, CPU only. AI-assisted: yes.
Author
Owner

@⁠CLHelper on GitHub · 2026-11-25 08:41 UTC · original

For the developer role on the project Discord: my Discord username is clhelper.

**@⁠CLHelper** on GitHub · 2026-11-25 08:41 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7157351436) For the developer role on the project Discord: my Discord username is `clhelper`.
Author
Owner

@⁠CLHelper on GitHub · 2026-11-25 13:13 UTC · original

@⁠sodove thanks, right again; fixed in 011a62a05. A shared location is now module+RVA as the trace names it (also host:<dll>+0x.., and only a file name, never a path) or unmapped; anything else, such as the bare address shims::module_offset gives outside every known module, is shown as unmapped in both report and report --json, and result.json keeps the original. New tests: a synthetic crash at a bare address through both report commands (the address is absent, unmapped present, result.json unchanged), and the site rule itself (module, host module, bare address, empty, path-like). 29/29 pass; with the rule removed the new report test fails. Also rewrapped two docstring lines of mine that were over 120 columns. AI-assisted.

**@⁠CLHelper** on GitHub · 2026-11-25 13:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7163466778) @⁠sodove thanks, right again; fixed in 011a62a05. A shared location is now module+RVA as the trace names it (also `host:<dll>+0x..`, and only a file name, never a path) or `unmapped`; anything else, such as the bare address `shims::module_offset` gives outside every known module, is shown as `unmapped` in both `report` and `report --json`, and `result.json` keeps the original. New tests: a synthetic crash at a bare address through both report commands (the address is absent, `unmapped` present, `result.json` unchanged), and the site rule itself (module, host module, bare address, empty, path-like). 29/29 pass; with the rule removed the new report test fails. Also rewrapped two docstring lines of mine that were over 120 columns. AI-assisted.
Author
Owner

@⁠CLHelper on GitHub · 2026-11-25 14:07 UTC · original

Before another round I had the tool read cold against its own claims, and fixed what that turned up (55fbc0249, 7d8742398):

  • Every shared field is now checked for its form, not only picked from a list: the call's outcome must be one the runtime writes (else other), an exception code hex or an exit code a number, the access kind read/write/execute (else other). A label of the runtime's shape (ID3D12Device::CreateFence, Xbox CreatePlacedResourceX (device slot 133)) is shown whole; that one was being cut to Xbox before, I had assumed labels carry arguments and checked it against 43 real labels since. A label with free text after its name (PipelineStream::Refused <reason>) keeps the name; anything else is (other).
  • The matrix's own fields: both formats showed the base ref and report --json every PR row whole (N:REF can name a local branch, plus verdicts and conflicted file names). The base is now its commit only and a PR row is number, status and skip reason; the rest stays in matrix.json.
  • A stale binary under a new head: run --build reused runtime/build; an export of another set unpacked over the same tree keeps the base's commit date in every file, older than the built objects, so the earlier set's gta6rt.exe could be recorded as built for this head. Builds now go to runtime/build-boot-matrix-<head>.
  • merge: a set branch checked out in the repository stops the merge before anything is written; Windows device names (con, nul, ...) are refused as set names. A PR merged and then reverted on the base stays already-merged (git merges an ancestor as a no-op); documented, with the way to test it (revert the revert, give it as N:REF).
  • result.json records the run's options (--env names, timeout, whether --overlay was given, configuration); the shared report shows LEONIDA_* names and counts others. Docs and docstring now match the code (the overlay is fresh only without --overlay; exit 1 on a failed build).

Kept on purpose: host:<dll>+0x.. locations show the DLL's file name (which driver or system DLL faulted), never a path.

36/36 pass; each fix has a test that fails when the fix is removed (checked by removing each). AI-assisted.

**@⁠CLHelper** on GitHub · 2026-11-25 14:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7164799646) Before another round I had the tool read cold against its own claims, and fixed what that turned up (55fbc0249, 7d8742398): - **Every shared field is now checked for its form**, not only picked from a list: the call's outcome must be one the runtime writes (else `other`), an exception code hex or an exit code a number, the access kind read/write/execute (else `other`). A label of the runtime's shape (`ID3D12Device::CreateFence`, `Xbox CreatePlacedResourceX (device slot 133)`) is shown whole; that one was being cut to `Xbox` before, I had assumed labels carry arguments and checked it against 43 real labels since. A label with free text after its name (`PipelineStream::Refused <reason>`) keeps the name; anything else is `(other)`. - **The matrix's own fields:** both formats showed the base ref and `report --json` every PR row whole (`N:REF` can name a local branch, plus verdicts and conflicted file names). The base is now its commit only and a PR row is number, status and skip reason; the rest stays in `matrix.json`. - **A stale binary under a new head:** `run --build` reused `runtime/build`; an export of another set unpacked over the same tree keeps the base's commit date in every file, older than the built objects, so the earlier set's `gta6rt.exe` could be recorded as built for this head. Builds now go to `runtime/build-boot-matrix-<head>`. - **merge:** a set branch checked out in the repository stops the merge before anything is written; Windows device names (`con`, `nul`, ...) are refused as set names. A PR merged and then reverted on the base stays `already-merged` (git merges an ancestor as a no-op); documented, with the way to test it (revert the revert, give it as `N:REF`). - **result.json** records the run's options (`--env` names, timeout, whether `--overlay` was given, configuration); the shared report shows `LEONIDA_*` names and counts others. Docs and docstring now match the code (the overlay is fresh only without `--overlay`; exit 1 on a failed build). Kept on purpose: `host:<dll>+0x..` locations show the DLL's file name (which driver or system DLL faulted), never a path. 36/36 pass; each fix has a test that fails when the fix is removed (checked by removing each). AI-assisted.
Author
Owner

@⁠sodove on GitHub · 2026-11-25 16:09 UTC · original

Retested 7d8742398 on native Windows 11 with Python 3.12.10. python -I tests/test_boot_matrix.py -v passed all 36 tests. The synthetic unmapped crash now shows unmapped in both the Markdown and JSON reports (2/2), and the local result.json retains the original location. The wrong-checkout and head-specific build-directory tests also passed. That resolves my earlier review comment.

AI-assisted (OpenAI Codex, GPT-6). Synthetic inputs only.

**@⁠sodove** on GitHub · 2026-11-25 16:09 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7167649653) Retested `7d8742398` on native Windows 11 with Python 3.12.10. `python -I tests/test_boot_matrix.py -v` passed all 36 tests. The synthetic unmapped crash now shows `unmapped` in both the Markdown and JSON reports (2/2), and the local `result.json` retains the original location. The wrong-checkout and head-specific build-directory tests also passed. That resolves my earlier review comment. AI-assisted (OpenAI Codex, GPT-6). Synthetic inputs only.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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