Skip to content

BUILD-2172: check development CLI flags against each producer - #6590

Merged
shayderrr merged 18 commits into
ItsNotRexed:mainfrom
Arkex-ai:dev/boot-trace
Nov 23, 2026
Merged

shayderrr merged 18 commits into
ItsNotRexed:mainfrom
Arkex-ai:dev/boot-trace

Conversation

@Arkex-ai

@Arkex-ai Arkex-ai commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claimed as BUILD-2172 in the coordination issue.

Depends on: #6587

What and why

The original boot trace adapter and guest scene entry landed with #6691 in cc6778089. This follow-up fixes the documentation test reported in review. Fenced commands for dev.py boot-trace and guest-scene now check flags against the producer that parses them. Discovery flags stay with dev.py. The regression test includes valid forwarded flags and flags from the wrong subcommand.

Tested

At 2bbbfbabe all 13 central CLI tests and four documentation flag tests passed on Windows. Linux discovery tests passed without a python alias on PATH. The previous checker fails against the forwarded flags already on main. The actual trace producer and scene runner are unchanged by this follow-up.

AI-assisted: yes

  • Synthetic inputs only. No game data, keys or decryption.
  • No translator changes.

@thehollowedone

Copy link
Copy Markdown

Independent Windows check of 580e1b44, including #6587 at 32818e93, with CPython 3.12.8. All 32 tests across boot-trace forwarding, tool discovery, the analyzer, and line endings passed.

I ran dev.py boot-trace from outside the checkout, with spaces and Unicode characters in both folder paths and in the relative input paths. Its stdout and stderr matched the direct analyzer byte for byte. Both commands exited 0 with two readable traces and exited 2 for a missing input or an invalid option. With one missing input, both still returned JSON for the readable trace. All inputs were synthetic.

AI-assisted.

@kapitche

Copy link
Copy Markdown
Contributor

Tested 580e1b4 merged with main 2ae1272 on Linux/Python 3.12.16: fail (the PR's own doc breaks tests/test_docs_cli_flags.py; plus a PATH dependency in one of its tests)

Commands (fresh worktree of upstream/main with the PR head merged, ~/src/Leonida/.venv/bin/python -I tests/<file>):

  • tests/test_dev_boot_trace.py -> Ran 5 tests, OK
  • tests/test_docs_cli_flags.py -> FAILED (failures=1): Lists differ: [('docs/dev-tools.md:43', 'scripts/dev.py', '--d3d12')] != []. The new docs/dev-tools.md shows python -I scripts/dev.py boot-trace "logs/startup trace.jsonl" --d3d12 "logs/d3d12 stderr.log" --json, and the docs checker looks for --d3d12 in scripts/dev.py, which forwards boot-trace arguments to tools/boot_trace.py without declaring any. Same test passes on plain upstream/main (rc=0), so it is this PR. ci.yml runs every tests/test_*.py, so CI would go red on it. All the other docs tests, test_runner_calls_all_tests, test_ci_registration and test_i18n_index exit 0.
  • tests/test_dev_discovery.py -> FAILED (failures=1, errors=1). Root cause: the test runs the inventory's help_argv, which is ["python", "-I", path, "--help"], and on this machine there is no bare python (only python3 and the venv path) -> FileNotFoundError: 'python'; the first subtest then aborts before producer.unlink(), which makes the second subtest report missing["present"] True. With a python symlink to the same interpreter put first on PATH, the file passes (Ran 4, OK). So it is environment-dependent, not a logic bug, but the inventory advertising a bare python command and the test requiring it will fail on any Linux box without a python alias, and the subtest cleanup should be in a finally/addCleanup.

Negative controls (run with the python shim on PATH): making discover() report present = True for every tool fails test_dev_discovery (2 subtests); changing the forwarder's cwd=Path.cwd() to cwd=ROOT fails 4 tests of test_dev_boot_trace (the relative-path/cwd behaviour is genuinely covered). Both files restored afterwards.

@Arkex-ai Arkex-ai changed the title BUILD-2172: forward boot-trace commands to the checkout analyzer BUILD-2172: check development CLI flags against each producer Nov 23, 2026
@Arkex-ai

Copy link
Copy Markdown
Contributor Author

Thanks for reproducing both failures. The discovery fix is in #6587 at 729032729; on Linux the four discovery tests pass without a bare python on PATH. After #6691 landed, I updated this PR to 2bbbfbabe. Its delta above #6587 checks forwarded options against their respective producers and includes a wrong-subcommand regression. All four documentation flag checks and the 13 central CLI tests pass on the updated head.

@Daazd

Daazd commented Nov 23, 2026

Copy link
Copy Markdown

Independent check (Linux, Python 3.12.3, Node 24.13, CPU only, no game files): head 2bbbfbabe merged onto main 6a4299563: merges clean.

  • python3 -I tests/test_dev_discovery.py: Ran 4 tests in 0.291s OK (exit 0)
  • python3 -I tests/test_docs_cli_flags.py: Ran 4 tests in 8.081s FAILED (failures=1) (exit 1)

Fixes test_dev_discovery on Linux (bare python in help_argv: FileNotFoundError where only python3 exists). Also clears the docs/dev-tools.md flags in test_docs_cli_flags, which overlaps #7242; the docs/embedded_shaders.md spirv-opt flags remaining in that test are #7476's.

AI-assisted (Claude Code).

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Adds scripts/dev.py with discover (JSON or text inventory of boot-trace and guest-scene producers, their paths, presence, help argv, and requirements) and a boot-trace subcommand that forwards arguments to tools/boot_trace.py preserving its output and exit code, with OSError and missing-producer cases returning 2. docs/dev-tools.md documents the entry point and JSON schema. Two test files verify help forwarding, partial JSON summaries, decoy producers in the caller's directory, and that discovery never executes producers.

Why merge

Gives one checkout-relative entry point to the boot-trace analyzer and an honest inventory of available tooling, without adding live-control claims the CLI cannot honor.

Verdict: Approve

@shayderrr

Copy link
Copy Markdown
Collaborator

Summary

Adds scripts/dev.py with discover (JSON or text inventory of boot-trace and guest-scene producers, their paths, presence, help argv, and requirements) and a boot-trace subcommand that forwards arguments to tools/boot_trace.py preserving its output and exit code, with OSError and missing-producer cases returning 2. docs/dev-tools.md documents the entry point and JSON schema. Two test files verify help forwarding, partial JSON summaries, decoy producers in the caller's directory, and that discovery never executes producers.

Why merge

Gives one checkout-relative entry point to the boot-trace analyzer and an honest inventory of available tooling, without adding live-control claims the CLI cannot honor.

Verdict: Approve

@shayderrr
shayderrr merged commit 3ae0654 into ItsNotRexed:main Nov 23, 2026
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants