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

Merged
CLHelper merged 9 commits from upstream-pr/569 into main 2026-11-28 08:02:17 +00:00
CLHelper commented 2026-11-24 08:34:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by CLHelper on 2026-11-24T08:34:44Z.


Claimed in the coordination issue as: TOOL-BOOT-MATRIX (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7126297344)

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)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5468774270 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/569). Originally posted by [CLHelper](https://github.com/CLHelper) on 2026-11-24T08:34:44Z. --- Claimed in the coordination issue as: TOOL-BOOT-MATRIX (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7126297344) ### 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)
sodove commented 2026-11-24 08:40:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-24T08:40:50Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7126429638 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7126429638). Originally posted by [sodove](https://github.com/sodove) on 2026-11-24T08:40:50Z. --- 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.
CLHelper commented 2026-11-25 08:27:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by CLHelper on 2026-11-25T08:27:51Z.


@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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7157055944 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7157055944). Originally posted by [CLHelper](https://github.com/CLHelper) on 2026-11-25T08:27:51Z. --- @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.
sodove commented 2026-11-25 08:38:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-25T08:38:24Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7157287267 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7157287267). Originally posted by [sodove](https://github.com/sodove) on 2026-11-25T08:38:24Z. --- 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.
CLHelper commented 2026-11-25 08:41:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by CLHelper on 2026-11-25T08:41:32Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7157351436 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7157351436). Originally posted by [CLHelper](https://github.com/CLHelper) on 2026-11-25T08:41:32Z. --- For the developer role on the project Discord: my Discord username is `clhelper`.
CLHelper commented 2026-11-25 13:13:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by CLHelper on 2026-11-25T13:13:28Z.


@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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7163466778 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7163466778). Originally posted by [CLHelper](https://github.com/CLHelper) on 2026-11-25T13:13:28Z. --- @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 commented 2026-11-25 14:07:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by CLHelper on 2026-11-25T14:07:42Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7164799646 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7164799646). Originally posted by [CLHelper](https://github.com/CLHelper) on 2026-11-25T14:07:42Z. --- 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.
sodove commented 2026-11-25 16:09:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-25T16:09:54Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7167649653 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/569#issuecomment-7167649653). Originally posted by [sodove](https://github.com/sodove) on 2026-11-25T16:09:54Z. --- 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.
DadaCap commented 2026-11-28 08:02:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T08:02:19Z.


Merged into main (merge commit 68595f4a7), approved by DadaCap (maintainer). Thanks!

Checked before merging: Tested in our local release candidate (main + 41 PRs): translator suite 512 files / 6,442 tests clean, Python suite with no new failure versus main, and 360 s game runs on an RTX 5080 with no regression. The merge was pinned to the head commit that was tested (7d8742398).

AI-assisted (Claude Code), posted for DadaCap.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7236321142 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/569#issuecomment-7236321142). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T08:02:19Z. --- Merged into `main` (merge commit 68595f4a7), approved by DadaCap (maintainer). Thanks! Checked before merging: Tested in our local release candidate (main + 41 PRs): translator suite 512 files / 6,442 tests clean, Python suite with no new failure versus main, and 360 s game runs on an RTX 5080 with no regression. The merge was pinned to the head commit that was tested (7d8742398). _AI-assisted (Claude Code), posted for DadaCap._
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
ProjectLeonida/mandy!569
No description provided.