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