upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/dev-tools.md
diff options
context:
space:
mode:
authorIssai <279266118+Arkex-ai@users.noreply.github.com>2026-11-23 13:04:30 -0300
committerGitHub <noreply@github.com>2026-11-23 10:04:30 -0600
commitcc67780893d315ce845c1fa6d13716774f1cb982 (patch)
tree592f7867213c66b7845e8bc2babc03a45be9fbb2 /docs/dev-tools.md
parent4155c236734c1989824da60eecc89e7e0e655796 (diff)
BUILD-2248: run a synthetic guest scene with persistent output from the development CLI (#6691)
Squash-merged after diff review of PR #6691 - BUILD-2248: run a synthetic guest scene with persistent output from the development CLI
Diffstat (limited to 'docs/dev-tools.md')
-rw-r--r--docs/dev-tools.md90
1 files changed, 90 insertions, 0 deletions
diff --git a/docs/dev-tools.md b/docs/dev-tools.md
new file mode 100644
index 000000000..0699814bc
--- /dev/null
+++ b/docs/dev-tools.md
@@ -0,0 +1,90 @@
1# Development tools
2
3From the Leonida checkout root, use Python 3 to list the development tools:
4
5```powershell
6python -I scripts/dev.py --help
7python -I scripts/dev.py discover
8python -I scripts/dev.py discover --json
9```
10
11From another directory, pass the path to `scripts/dev.py`, quoting it if needed.
12The inventory always describes the checkout containing that script.
13
14`boot-trace` points to the analyzer for startup JSONL and D3D12 stderr logs.
15`guest-scene` points to the headless synthetic guest runner. Run a listed help
16command from the checkout root to see the producer's options. The inventory
17checks for each producer script and lists its prerequisites without checking
18those prerequisites or running the producer. Live attach, pause, step, input,
19and screenshots are unavailable through this entry point.
20
21## JSON output
22
23`discover --json` writes one object to stdout:
24
25- `schema_version` identifies the format. The current version is `1`.
26- `tools` lists entries by `id`. Each `path` uses forward slashes and is
27 relative to the checkout root. `present` indicates whether the script is
28 a file. `help_argv` is a list of arguments for a command run from the checkout
29 root, or `null` when the script is missing. `requirements` lists prerequisites
30 for using the producer.
31- `live_controls` contains an `available` boolean and a `reason`.
32
33Exit code `0` indicates that the inventory was emitted, including when a
34producer script is missing. Invalid CLI arguments exit with code `2`.
35
36## Analyze a boot trace
37
38Use the existing analyzer through the development CLI:
39
40```powershell
41python -I scripts/dev.py boot-trace --help
42python -I scripts/dev.py boot-trace "logs/startup trace.jsonl"
43python -I scripts/dev.py boot-trace "logs/startup trace.jsonl" --d3d12 "logs/d3d12 stderr.log" --json
44```
45
46Pass a startup JSONL from `gta6rt --trace`, a D3D12 stderr log from
47`gta6rt --trace-d3d12`, or both. Relative input paths are interpreted from
48the directory where you run the CLI. From outside the checkout, give the
49path to `scripts/dev.py` and keep the trace paths relative to your directory.
50
51The analyzer supplies the help, output, diagnostics and exit status. If one
52input fails but the other can be read, `--json` can still emit a partial
53summary on stdout with a diagnostic on stderr and exit code `2`. If neither
54input can be analyzed, there is no JSON summary. The summary describes the
55recorded events, and the exit status reports the analysis result.
56
57You can also run `python -I tools/boot_trace.py` with the same arguments.
58
59## Run a synthetic guest scene
60
61Use the existing headless runner with a loader and guest built on Windows
62with Vulkan, static SDL3 and `LEONIDA_GUEST_SCENE=ON`. Supply the synthetic
63M1.5 shader fixture root containing `spirv/`. See the
64[runtime instructions](../runtime/README.md#a-600-frame-headless-guest-scene)
65for the build, fixture and Wine setup.
66
67```powershell
68python -I scripts/dev.py guest-scene --help
69python -I scripts/dev.py guest-scene --loader "build/gta6rt.exe" --guest "build/tiny_guest_draw.exe" --shaders "m15 shaders" --out "scene run" --negative-controls
70```
71
72Pass `--out PATH` or `--out=PATH` with a new or empty directory. Relative
73paths are interpreted from the directory where you run the CLI, including
74when you invoke `scripts/dev.py` by its full path from another directory.
75
76The CLI forwards the runner's exit code and diagnostics. Exit code `0`
77means the scene checks passed. Exit code `1` can indicate a scene check
78failure or a failure before the runner can write a report, such as an
79output directory it cannot create. Exit code `2` indicates a usage or
80prerequisite error.
81
82When the runner writes `report.json`, it prints the path. Open that file
83for the scene result and per-run details. For example, if the full run
84starts and the loader exits with an error, `runs.full.returncode` records
85the loader's exit code while the CLI returns the runner's exit code.
86The output directory also holds any logs, frame records and PPM images
87the runner produced. If the runner rejects an occupied directory, any
88report already there belongs to an earlier run.
89
90You can also invoke `python -I scripts/run_guest_scene.py` directly.