launcher: add preparation phase timing and tools/boot_timeline.py #485

Open
glovepost wants to merge 1 commit from upstream-pr/485 into main
glovepost commented 2026-11-29 15:42:08 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by glovepost on 2026-11-29T15:42:08Z.


Narrowed per review to Part 1 (launch-preparation phase timing and tools/boot_timeline.py). The remaining five launcher pieces (--prepare-only manifest, --warm-launch, quieter refusal reporting, wait-report/stall diagnostics, and live-session D3D12 tracing) are backed up on glovepost/TuxBox:backup/pr485-full (a85109a1) to open separately after earlier PRs land.

Summary

  • project_tuxbox/scarlett_prep.py: record elapsed seconds per phase (scan, shaders, optimise, pipelines) and log Launch preparation phases: ... at the end of preparation.
  • project_tuxbox/shader_prep.py: record elapsed seconds per phase (shaders, linked shaders, chase shaders, compute PSOs) and log Launch preparation phases: ....
  • tools/boot_timeline.py: parse one ProjectScarlett log into boot milestones (first_frame, profile_selected, first_3d_draw, world_import_16, device_lost), 30 s HUD/PSO progress windows, and optional TUXBOX_WAIT_REPORT=1 wait summaries.
  • tests/test_boot_timeline.py, tests/test_scarlett_prep.py: cover timeline parsing/rendering and Launch preparation phases: output.

Verification

  • python3 tuxbox.py check --no-gpu passed 9/9 checks on commit HEAD:
    • Python tests: 740 passed (including tests.test_boot_timeline and tests.test_scarlett_prep)
    • Shader compiler tests: 648 + 3 + 2 passed
    • DXBC tests: 120 passed
    • XG layout tests: 24 passed, 1 ignored; XG entry point tests: 7 passed
    • Storage codec tests: 22 passed
    • ACP HAL tests: 9 passed
    • D3D12 Windows typecheck: passed
  • GPU tests (tuxbox.py check) and ProjectScarlett were not run against this narrowed commit (a85109a1 previously ran offline boot_timeline parsing against <log_path>; only tuxbox.py check --no-gpu ran after the rebase/split).

AI-assisted: split, rebased, and tested with LLM tooling.

<!-- greyfinch-sync:brcly/TuxBox:issue:5552306913 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/485). Originally posted by [glovepost](https://github.com/glovepost) on 2026-11-29T15:42:08Z. --- Narrowed per review to Part 1 (launch-preparation phase timing and `tools/boot_timeline.py`). The remaining five launcher pieces (`--prepare-only` manifest, `--warm-launch`, quieter refusal reporting, wait-report/stall diagnostics, and live-session D3D12 tracing) are backed up on `glovepost/TuxBox:backup/pr485-full` (`a85109a1`) to open separately after earlier PRs land. ### Summary - `project_tuxbox/scarlett_prep.py`: record elapsed seconds per phase (`scan`, `shaders`, `optimise`, `pipelines`) and log `Launch preparation phases: ...` at the end of preparation. - `project_tuxbox/shader_prep.py`: record elapsed seconds per phase (`shaders`, `linked shaders`, `chase shaders`, `compute PSOs`) and log `Launch preparation phases: ...`. - `tools/boot_timeline.py`: parse one ProjectScarlett log into boot milestones (`first_frame`, `profile_selected`, `first_3d_draw`, `world_import_16`, `device_lost`), 30 s HUD/PSO progress windows, and optional `TUXBOX_WAIT_REPORT=1` wait summaries. - `tests/test_boot_timeline.py`, `tests/test_scarlett_prep.py`: cover timeline parsing/rendering and `Launch preparation phases:` output. ### Verification - `python3 tuxbox.py check --no-gpu` passed 9/9 checks on commit HEAD: - Python tests: 740 passed (including `tests.test_boot_timeline` and `tests.test_scarlett_prep`) - Shader compiler tests: 648 + 3 + 2 passed - DXBC tests: 120 passed - XG layout tests: 24 passed, 1 ignored; XG entry point tests: 7 passed - Storage codec tests: 22 passed - ACP HAL tests: 9 passed - D3D12 Windows typecheck: passed - GPU tests (`tuxbox.py check`) and ProjectScarlett were not run against this narrowed commit (`a85109a1` previously ran offline `boot_timeline` parsing against `<log_path>`; only `tuxbox.py check --no-gpu` ran after the rebase/split). AI-assisted: split, rebased, and tested with LLM tooling.
glovepost commented 2026-11-29 21:56:08 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by glovepost on 2026-11-29T21:56:08Z.


@brcly Quick heads-up: I rebased #485 onto main and fixed the log_window_command shutil.which lookup (a85109a1) a couple minutes after waiting-on-author was added. All 3/3 CI checks are green and the PR is MERGEABLE.

ProjectScarlett was not run with this branch (host checks only). Let me know whether you'd prefer #485 reviewed as-is or split into smaller PRs along the lines of the updated CONTRIBUTING.md.

<!-- greyfinch-sync:brcly/TuxBox:comment:7263270671 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/485#issuecomment-7263270671). Originally posted by [glovepost](https://github.com/glovepost) on 2026-11-29T21:56:08Z. --- @brcly Quick heads-up: I rebased #485 onto `main` and fixed the `log_window_command` `shutil.which` lookup (`a85109a1`) a couple minutes after `waiting-on-author` was added. All `3/3` CI checks are green and the PR is `MERGEABLE`. ProjectScarlett was **not** run with this branch (host checks only). Let me know whether you'd prefer #485 reviewed as-is or split into smaller PRs along the lines of the updated `CONTRIBUTING.md`.
brcly commented 2026-11-29 22:03:02 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T22:03:02Z.


Thanks for rebasing. I'd prefer it split, along the lines of the updated CONTRIBUTING.md. It changes launches for everyone in six unrelated ways, and some of them need their own look:

  1. Launch-preparation phase timing and tools/boot_timeline.py. Useful now, since compile time is our focus; this one first, please.
  2. The crash-report watcher in host.py.
  3. --log-window.
  4. Proton defaults (PROTONFIXES_DISABLE, PROTON_FSR4_UPGRADE) and the RLIMIT_NICE promotion. These change how every launch runs, so they need a sentence each on why, and what they do on a machine that doesn't need them.
  5. Filtering Wine/Proton/OpenXR log lines. Careful here: a filtered line is one we can't see when diagnosing a run, so I'd like the filter to show what it hides (a count at least).
  6. Quieter refusal reporting.

Small PRs like these are quick to review and merge on their own.

<!-- greyfinch-sync:brcly/TuxBox:comment:7263360563 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/485#issuecomment-7263360563). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T22:03:02Z. --- Thanks for rebasing. I'd prefer it split, along the lines of the updated `CONTRIBUTING.md`. It changes launches for everyone in six unrelated ways, and some of them need their own look: 1. **Launch-preparation phase timing and `tools/boot_timeline.py`.** Useful now, since compile time is our focus; this one first, please. 2. **The crash-report watcher** in `host.py`. 3. **`--log-window`.** 4. **Proton defaults** (`PROTONFIXES_DISABLE`, `PROTON_FSR4_UPGRADE`) **and the `RLIMIT_NICE` promotion.** These change how every launch runs, so they need a sentence each on why, and what they do on a machine that doesn't need them. 5. **Filtering Wine/Proton/OpenXR log lines.** Careful here: a filtered line is one we can't see when diagnosing a run, so I'd like the filter to show what it hides (a count at least). 6. **Quieter refusal reporting.** Small PRs like these are quick to review and merge on their own.
glovepost commented 2026-11-29 22:51:58 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by glovepost on 2026-11-29T22:51:58Z.


Narrowed #485 onto origin/main (f360038d) to Part 1 only: preparation phase timing (project_tuxbox/scarlett_prep.py, project_tuxbox/shader_prep.py) and tools/boot_timeline.py + tests.

The full original branch (a85109a1) is backed up on glovepost/TuxBox:backup/pr485-full; parts 2–6 are held off PR until earlier open PRs land.

Verified after the split with python3 tuxbox.py check --no-gpu (9/9 checks passed, 740 Python tests; GPU tests and ProjectScarlett did not run on this split commit).

<!-- greyfinch-sync:brcly/TuxBox:comment:7264010284 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/485#issuecomment-7264010284). Originally posted by [glovepost](https://github.com/glovepost) on 2026-11-29T22:51:58Z. --- Narrowed #485 onto `origin/main` (`f360038d`) to **Part 1 only**: preparation phase timing (`project_tuxbox/scarlett_prep.py`, `project_tuxbox/shader_prep.py`) and `tools/boot_timeline.py` + tests. The full original branch (`a85109a1`) is backed up on `glovepost/TuxBox:backup/pr485-full`; parts 2–6 are held off PR until earlier open PRs land. Verified after the split with `python3 tuxbox.py check --no-gpu` (9/9 checks passed, 740 Python tests; GPU tests and ProjectScarlett did not run on this split commit).
glovepost commented 2026-11-30 01:47:57 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by glovepost on 2026-11-30T01:47:57Z.


Rebased onto main (f482572a, commit 3a9f8720093e) with no functional changes from 74e18049, and ran the full check on NVIDIA (headless xvfb-run with WAYLAND_DISPLAY=""):

  • Command: WAYLAND_DISPLAY="" TUXBOX_CHECK_JOBS=2 DXC=<dxc> xvfb-run -a -s "-screen 0 2560x1440x24" python3 tuxbox.py check --changed --adapter 10de:1e84 --proton <proton> --prefix <prefix> --windows-dxc <windows-dxc> (ran the full suite because scarlett_prep.py is outside --changed's subset table)
  • GPU / driver / backend: NVIDIA GeForce RTX 2070 SUPER (10de:1e84), driver 620.73.04, GE-Proton11-14
  • Results: Full host + build + Lanes and fixtures on the GPU + all D3D12 regression controls + Shader translator on the GPU all passed (14 passed, 0 failed, 0 not run).
  • Still missing: AMD GPU checks. ProjectScarlett was not run on this commit.

Evidence: TuxBox check of 3a9f8720093e, no uncommitted changes, GPU 10de:1e84: 14 passed, 0 failed, 0 not run

<!-- greyfinch-sync:brcly/TuxBox:comment:7266449996 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/485#issuecomment-7266449996). Originally posted by [glovepost](https://github.com/glovepost) on 2026-11-30T01:47:57Z. --- Rebased onto `main` (`f482572a`, commit `3a9f8720093e`) with no functional changes from `74e18049`, and ran the full check on NVIDIA (headless `xvfb-run` with `WAYLAND_DISPLAY=""`): - **Command:** `WAYLAND_DISPLAY="" TUXBOX_CHECK_JOBS=2 DXC=<dxc> xvfb-run -a -s "-screen 0 2560x1440x24" python3 tuxbox.py check --changed --adapter 10de:1e84 --proton <proton> --prefix <prefix> --windows-dxc <windows-dxc>` (ran the full suite because `scarlett_prep.py` is outside `--changed`'s subset table) - **GPU / driver / backend:** NVIDIA GeForce RTX 2070 SUPER (`10de:1e84`), driver `620.73.04`, `GE-Proton11-14` - **Results:** Full host + build + `Lanes and fixtures on the GPU` + all `D3D12 regression controls` + `Shader translator on the GPU` all passed (**14 passed, 0 failed, 0 not run**). - **Still missing:** AMD GPU checks. ProjectScarlett was not run on this commit. `Evidence: TuxBox check of 3a9f8720093e, no uncommitted changes, GPU 10de:1e84: 14 passed, 0 failed, 0 not run`
NickStallman commented 2026-11-30 03:11:46 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T03:11:46Z.


The AMD check you were missing, on 3a9f8720: AMD iGPU (1002:13c0, RADV, Mesa 26.0.8, GE-Proton11-14, Linux), full python tuxbox.py check: 199 pass, 0 fail. A game was loading on the other card for part of it. ProjectScarlett was not run on this commit.

Evidence: TuxBox check of 3a9f872009, no uncommitted changes, GPU 1002:13c0: 14 passed, 0 failed, 0 not run

<!-- greyfinch-sync:brcly/TuxBox:comment:7267672228 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/485#issuecomment-7267672228). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T03:11:46Z. --- The AMD check you were missing, on 3a9f8720: AMD iGPU (`1002:13c0`, RADV, Mesa 26.0.8, GE-Proton11-14, Linux), full `python tuxbox.py check`: 199 pass, 0 fail. A game was loading on the other card for part of it. ProjectScarlett was not run on this commit. Evidence: TuxBox check of 3a9f8720093e, no uncommitted changes, GPU 1002:13c0: 14 passed, 0 failed, 0 not run
brcly commented 2026-11-30 11:45:22 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T11:45:22Z.


Thanks for splitting it, and for the runs on both vendors. The phase timing in scarlett_prep.py and shader_prep.py is good, and I'd merge that part as it is.

tools/boot_timeline.py doesn't work on main's logs yet, though. I ran it on one of our boots that reached the world (1,246 presents), and it found only first_frame. Of the lines it looks for:

  • HUD shaders ready=, root view wide import #16, recorded Xbox DispatchMesh and profile PSO end aren't printed anywhere on main. I assume they come from the parts you held back.
  • save: enumerate containers is printed only when the save-service log is on.

So with main as it is, the windows table stays empty and three of the five milestones never appear. Could you either:

  • make the tool read lines main does print. For example, the first mesh draw, world entry and pipeline progress can come from what TUXBOX_LOG already writes; or
  • move the tool into the later PR that adds those log lines,

and in either case show its output from a real main boot in the PR? Then this one is ready.

<!-- greyfinch-sync:brcly/TuxBox:comment:7277478002 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/485#issuecomment-7277478002). Originally posted by [brcly](https://github.com/brcly) on 2026-11-30T11:45:22Z. --- Thanks for splitting it, and for the runs on both vendors. The phase timing in `scarlett_prep.py` and `shader_prep.py` is good, and I'd merge that part as it is. `tools/boot_timeline.py` doesn't work on main's logs yet, though. I ran it on one of our boots that reached the world (1,246 presents), and it found only `first_frame`. Of the lines it looks for: - `HUD shaders ready=`, `root view wide import #16`, `recorded Xbox DispatchMesh` and `profile PSO end` aren't printed anywhere on main. I assume they come from the parts you held back. - `save: enumerate containers` is printed only when the save-service log is on. So with main as it is, the windows table stays empty and three of the five milestones never appear. Could you either: - make the tool read lines main does print. For example, the first mesh draw, world entry and pipeline progress can come from what `TUXBOX_LOG` already writes; or - move the tool into the later PR that adds those log lines, and in either case show its output from a real main boot in the PR? Then this one is ready.
brcly commented 2026-12-02 21:31:04 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-12-02T21:31:04Z.


Thanks for narrowing this down, the phase timing and boot_timeline.py are useful. It now conflicts with main in project_tuxbox/scarlett_prep.py. Could you rebase onto main and check the Launch preparation phases: line still lands where the test expects? We'll merge once it's clean and CI is green.

<!-- greyfinch-sync:brcly/TuxBox:comment:7359391419 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/485#issuecomment-7359391419). Originally posted by [brcly](https://github.com/brcly) on 2026-12-02T21:31:04Z. --- Thanks for narrowing this down, the phase timing and `boot_timeline.py` are useful. It now conflicts with main in `project_tuxbox/scarlett_prep.py`. Could you rebase onto main and check the `Launch preparation phases:` line still lands where the test expects? We'll merge once it's clean and CI is 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/485:upstream-pr/485'
git switch 'upstream-pr/485'

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/485'
git switch 'upstream-pr/485'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/485'
git switch 'upstream-pr/485'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/485'
git switch 'main'
git merge --squash 'upstream-pr/485'
git switch 'main'
git merge --ff-only 'upstream-pr/485'
git switch 'main'
git merge 'upstream-pr/485'
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
brcly/TuxBox!485
No description provided.