diff options
| author | Rafael <rafaelalvesp2005@gmail.com> | 2026-11-23 15:36:26 -0300 |
|---|---|---|
| committer | Rafael <rafaelalvesp2005@gmail.com> | 2026-11-23 15:36:26 -0300 |
| commit | 63f0e0dea3a9d44201db408c4e2c3f2f5b2b94d6 (patch) | |
| tree | 86f0dcad8070e2a3a693ef4897aa83950cfeb224 /docs/dev-tools.md | |
| parent | f78f7d6a2a9364cb128c03ac539fe540d5c70df1 (diff) | |
| parent | 6dda0630bd6fc0514baadb94fb98e36bd7d64c0b (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.md | 93 |
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 | |||
| 3 | From the Leonida checkout root, use Python 3 to list the development tools: | ||
| 4 | |||
| 5 | ```powershell | ||
| 6 | python -I scripts/dev.py --help | ||
| 7 | python -I scripts/dev.py discover | ||
| 8 | python -I scripts/dev.py discover --json | ||
| 9 | ``` | ||
| 10 | |||
| 11 | From another directory, pass the path to `scripts/dev.py`, quoting it if needed. | ||
| 12 | The 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 | ||
| 16 | command from the checkout root to see the producer's options. The text | ||
| 17 | inventory displays commands for PowerShell on Windows and POSIX shells | ||
| 18 | on other platforms. The inventory | ||
| 19 | checks for each producer script and lists its prerequisites without checking | ||
| 20 | those prerequisites or running the producer. Live attach, pause, step, input, | ||
| 21 | and 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 | |||
| 36 | Exit code `0` indicates that the inventory was emitted, including when a | ||
| 37 | producer script is missing. Invalid CLI arguments exit with code `2`. | ||
| 38 | |||
| 39 | ## Analyze a boot trace | ||
| 40 | |||
| 41 | Use the existing analyzer through the development CLI: | ||
| 42 | |||
| 43 | ```powershell | ||
| 44 | python -I scripts/dev.py boot-trace --help | ||
| 45 | python -I scripts/dev.py boot-trace "logs/startup trace.jsonl" | ||
| 46 | python -I scripts/dev.py boot-trace "logs/startup trace.jsonl" --d3d12 "logs/d3d12 stderr.log" --json | ||
| 47 | ``` | ||
| 48 | |||
| 49 | Pass a startup JSONL from `gta6rt --trace`, a D3D12 stderr log from | ||
| 50 | `gta6rt --trace-d3d12`, or both. Relative input paths are interpreted from | ||
| 51 | the directory where you run the CLI. From outside the checkout, give the | ||
| 52 | path to `scripts/dev.py` and keep the trace paths relative to your directory. | ||
| 53 | |||
| 54 | The analyzer supplies the help, output, diagnostics and exit status. If one | ||
| 55 | input fails but the other can be read, `--json` can still emit a partial | ||
| 56 | summary on stdout with a diagnostic on stderr and exit code `2`. If neither | ||
| 57 | input can be analyzed, there is no JSON summary. The summary describes the | ||
| 58 | recorded events, and the exit status reports the analysis result. | ||
| 59 | |||
| 60 | You can also run `python -I tools/boot_trace.py` with the same arguments. | ||
| 61 | |||
| 62 | ## Run a synthetic guest scene | ||
| 63 | |||
| 64 | Use the existing headless runner with a loader and guest built on Windows | ||
| 65 | with Vulkan, static SDL3 and `LEONIDA_GUEST_SCENE=ON`. Supply the synthetic | ||
| 66 | M1.5 shader fixture root containing `spirv/`. See the | ||
| 67 | [runtime instructions](../runtime/README.md#a-600-frame-headless-guest-scene) | ||
| 68 | for the build, fixture and Wine setup. | ||
| 69 | |||
| 70 | ```powershell | ||
| 71 | python -I scripts/dev.py guest-scene --help | ||
| 72 | python -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 | |||
| 75 | Pass `--out PATH` or `--out=PATH` with a new or empty directory. Relative | ||
| 76 | paths are interpreted from the directory where you run the CLI, including | ||
| 77 | when you invoke `scripts/dev.py` by its full path from another directory. | ||
| 78 | |||
| 79 | The CLI forwards the runner's exit code and diagnostics. Exit code `0` | ||
| 80 | means the scene checks passed. Exit code `1` can indicate a scene check | ||
| 81 | failure or a failure before the runner can write a report, such as an | ||
| 82 | output directory it cannot create. Exit code `2` indicates a usage or | ||
| 83 | prerequisite error. | ||
| 84 | |||
| 85 | When the runner writes `report.json`, it prints the path. Open that file | ||
| 86 | for the scene result and per-run details. For example, if the full run | ||
| 87 | starts and the loader exits with an error, `runs.full.returncode` records | ||
| 88 | the loader's exit code while the CLI returns the runner's exit code. | ||
| 89 | The output directory also holds any logs, frame records and PPM images | ||
| 90 | the runner produced. If the runner rejects an occupied directory, any | ||
| 91 | report already there belongs to an earlier run. | ||
| 92 | |||
| 93 | You can also invoke `python -I scripts/run_guest_scene.py` directly. | ||