From 589b2d28fa70c2b5dea1be111d414b68340f8897 Mon Sep 17 00:00:00 2001 From: MoonEyes <14891700+MoonEyes@users.noreply.github.com> Date: Mon, 30 Nov 2026 10:29:56 +0100 Subject: [PATCH 1/6] docs: how to measure the D3D12 runtime's frame rates, and its LEONIDA_* variables d3d12/docs/findings.md was reachable from d3d12/README.md alone, so a night of runs repeated measurements it already holds. Index it, point AGENTS.md at it, say how to measure (a switch by turns inside one run), and list the variables the runtime names from its own sources: 415 of 669 were in no Markdown file. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 3 + d3d12/docs/switches.md | 707 +++++++++++++++++++++++++++++++++++ docs/README.md | 3 + docs/measuring_fps.md | 82 ++++ tests/test_d3d12_switches.py | 123 ++++++ tools/d3d12_switches.py | 262 +++++++++++++ 6 files changed, 1180 insertions(+) create mode 100644 d3d12/docs/switches.md create mode 100644 docs/measuring_fps.md create mode 100644 tests/test_d3d12_switches.py create mode 100644 tools/d3d12_switches.py diff --git a/AGENTS.md b/AGENTS.md index 6baca4668f..c0ea6e3f5f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -67,6 +67,9 @@ loader that maps the game's executable and resolves its imports to shims. Nothin - The format or behaviour may already be measured in `docs/design.md`. Quote the file and offset a claim comes from, or call it a hypothesis. - Count over the whole corpus, not a sample: a rule that holds for 400 shaders can fail on the other 26 000. +- Frame rates of the D3D12 runtime (`d3d12/`): search [d3d12/docs/findings.md](d3d12/docs/findings.md) for the switch or + function before measuring it, and measure as [docs/measuring_fps.md](docs/measuring_fps.md) says (a switch by turns + inside one run). The variables are listed in [d3d12/docs/switches.md](d3d12/docs/switches.md). ## Test without the game first diff --git a/d3d12/docs/switches.md b/d3d12/docs/switches.md new file mode 100644 index 0000000000..b2cbe4f294 --- /dev/null +++ b/d3d12/docs/switches.md @@ -0,0 +1,707 @@ +# The D3D12 runtime's `LEONIDA_*` variables + +Made by `python -I tools/d3d12_switches.py --out d3d12/docs/switches.md` from the sources of `d3d12/`; do not +edit it by hand. It says which names exist and what the code's own comments say of them. It is **not** a list of +recommended settings and says nothing of what a switch gains: for that read [findings.md](findings.md) first, +and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. + +641 names; 603 of them are named in a comment of the code, the others have none yet. + +- **Kind**: how the code reads it, where that can be told. "see the code" is a number, a path, a list or a + switch read some other way; its default is not given here. +- **A/B**: `LEONIDA_AB` can turn it while the title runs (builds with `diagnostics`), where the code reads it by + name that way. Blank means it was not found so, not that it cannot; the comment may say more. +- **L**: the NVIDIA launcher (`d3d12/scripts/play-nvidia.ps1`) has an assignment for it. +- **F**: named in [findings.md](findings.md), which is where a measurement would be. +- **In the code's words**: the sentence of the comment that names it, cut to one line. Comments go out of date; + the code is what counts. + +## leonida + +| Name | Kind | A/B | L | F | Named in | In the code's words | +|---|---|---|---|---|---|---| +| `LEONIDA_AUDIO_CAPTURE` | see the code | | | | `leonida/main.rs` +1 | `LEONIDA_AUDIO_CAPTURE=<file.wav>` records what the title plays, 48 kHz stereo 16-bit, through process loopback: our own process tree only, never the rest of the host's mix. | +| `LEONIDA_CARD_AWAKE` | see the code | yes | yes | yes | `leonida/replay.rs` +4 | Keeps the card's clocks up between submissions (`LEONIDA_CARD_AWAKE=1`; off by default). | +| `LEONIDA_CRASH_SAVE` | see the code | | | | `leonida/run.rs` | `LEONIDA_CRASH_SAVE=<rva>:<len>,...` (hex) writes those title ranges to `crash-<rva>.bin` in the cache dir on a crash. | +| `LEONIDA_D3D12_DRED` | off unless set and not `0` | | | yes | `leonida/replay.rs` +7 | Whether device-removed data is on (`LEONIDA_D3D12_DRED`, diagnostics builds). | +| `LEONIDA_DUMP_MATCH` | see the code | | | | `leonida/translate.rs` | `LEONIDA_DUMP_MATCH=<dir>;<text>\|<text>...`: the containers whose line holds one of the texts (a name, `#hash`), as the title has them. | +| `LEONIDA_DXIL` | see the code | | | | `leonida/main.rs` +1 | The DLL is found at `LEONIDA_DXIL` if set, else the newest Windows SDK's `bin\<version>\x64\dxil.dll`, else wherever `LoadLibrary` finds it. | +| `LEONIDA_EMIT_DUMP` | see the code | | | | `leonida/translate.rs` +1 | `LEONIDA_EMIT_DUMP` with `--list`: every emitted shader as a file. | +| `LEONIDA_FAIL_DUMP` | see the code | | | | `leonida/translate.rs` | `LEONIDA_FAIL_DUMP=<dir>`: the first 3 containers of each failure reason, as the title has them (`.cdxil`), to work on a translator gap offline | +| `LEONIDA_FIND_PLAYER` | see the code | | | | `leonida/player.rs` +2 | Diagnostics only (`LEONIDA_FIND_PLAYER=<start s>,<seconds>`): finds, at run time, where the title keeps the local player's position, and how to reach it from the title's image, so that a teleport can write there (`player... | +| `LEONIDA_FSR_UPSCALER` | see the code | | | yes | `leonida/run.rs` +6 | The title upscales with FidelityFX on Series S, and on the other consoles when the loader makes it (`LEONIDA_FSR_UPSCALER=1`, leonida-loader's hooks.rs). | +| `LEONIDA_GAME_ACTIONS` | see the code | | | | `leonida/game_actions.rs` +7 | Off unless `LEONIDA_GAME_ACTIONS=1`. | +| `LEONIDA_GAME_ACTIONS_RUN` | see the code | | | | `leonida/game_actions.rs` | ...by default until it has been seen to work in the title). - `LEONIDA_GAME_ACTIONS_RUN="<s>:<command>;..."` asks for commands that many seconds after the start, for a test without the keyboard: `info`, `cheat <n>`, `wanted... | +| `LEONIDA_GAME_ACTIONS_WARP` | see the code | | | | `leonida/game_actions.rs` +1 | ...ts results into the log: the arguments are the asker's). - `LEONIDA_GAME_ACTIONS_WARP=1` lets a teleport write the ped's position on the title's thread: an experiment, the title's own function for moving a ped was not fo... | +| `LEONIDA_HOST_MAX_WAVE` | see the code | | | | `leonida/translate.rs` | `LEONIDA_HOST_MAX_WAVE=32`: translate as for a host whose waves have at most 32 lanes (as the runtime does on such a card). | +| `LEONIDA_HOST_RDNA` | see the code | | | | `leonida/translate.rs` | `LEONIDA_HOST_RDNA=1`: as for an AMD RDNA card (`LEONIDA_RDNA_FLOAT`). | +| `LEONIDA_HOST_WAVE` | see the code | | | yes | `leonida/main.rs` | Set `LEONIDA_HOST_WAVE` and `LEONIDA_VIEW_LIMIT` to what the run's log says of the host. | +| `LEONIDA_INDIRECT_BATCH` | see the code | | yes | yes | `leonida/replay.rs` +9 | `LEONIDA_INDIRECT_BATCH=0`: each on its own, or in windows ([`windows`])). | +| `LEONIDA_KBM_SPEED` | see the code | | | | `leonida/player_context.rs` | `LEONIDA_PLAYER_VEHICLE_AT=off` leaves it unused. - `LEONIDA_KBM_SPEED=1`: how fast the ped moves ([`SpeedRule`]). | +| `LEONIDA_KEYS_FILE` | see the code | | | | `leonida/player_find.rs` +2 | Then, for `<seconds>`, it reads every candidate's position every `LEONIDA_PLAYER_INTERVAL_MS` (250) together with the keys held at that moment (the file `LEONIDA_KEYS_FILE` names). | +| `LEONIDA_LUA` | see the code | | | | `leonida/run.rs` +2 | `LEONIDA_LUA=0` turns it all off: no thread, and a present pays one atomic load in [`tick`]. | +| `LEONIDA_NATIVE_ALL` | see the code | | | | `leonida/native_scan.rs` | ... handlers for a run to be listed and to enter the union. - `LEONIDA_NATIVE_ALL=1`: also scan read-only and image-backed memory (the default is private/mapped memory a program can write to). - `LEONIDA_NATIVE_LOOSE=1`: a... | +| `LEONIDA_NATIVE_LOOSE` | see the code | | | | `leonida/native_scan.rs` | ...efault is private/mapped memory a program can write to). - `LEONIDA_NATIVE_LOOSE=1`: a pointer into code counts even when the target is not a function start (the default needs a `.pdata` function start, or a 16-aligned b... | +| `LEONIDA_NATIVE_MIN_DISTINCT` | see the code | | | | `leonida/native_scan.rs` | Tuning, all optional: - `LEONIDA_NATIVE_MIN_RUN` (default 64): fewest array elements in a run. - `LEONIDA_NATIVE_MIN_DISTINCT` (default 200): fewest distinct handlers for a run to be listed and to enter the union. - `LEO... | +| `LEONIDA_NATIVE_MIN_RUN` | see the code | | | | `leonida/native_scan.rs` | Tuning, all optional: - `LEONIDA_NATIVE_MIN_RUN` (default 64): fewest array elements in a run. - `LEONIDA_NATIVE_MIN_DISTINCT` (default 200): fewest distinct handlers for a run to be listed and to enter the union. - `LEO... | +| `LEONIDA_NATIVE_SCAN` | see the code | | | | `leonida/native_scan.rs` +1 | Diagnostics only (`LEONIDA_NATIVE_SCAN`): looks, at run time, for the tables the title's script engine calls its commands through. | +| `LEONIDA_NATIVE_U32` | see the code | | | | `leonida/native_scan.rs` | ...ction start, or a 16-aligned byte after `int3` padding). - `LEONIDA_NATIVE_U32=1`: also looks for arrays of 32-bit offsets that are handler addresses relative to some base `B` (see `OffsetArray`).... | +| `LEONIDA_OWN_UPSCALER` | see the code | | | | `leonida/run.rs` +4 | LEONIDA_RENDER_SCALE / LEONIDA_OWN_UPSCALER / LEONIDA_NO_WATCHDOG title patches. | +| `LEONIDA_PAIRS` | see the code | | | | `leonida/translate.rs` | Shaders named in `LEONIDA_PAIRS` (`vs+ps,...`, label substrings), kept to build those pipelines after the walk. | +| `LEONIDA_PED_DUMP` | see the code | | | | `leonida/player_context.rs` | `LEONIDA_PED_DUMP=<folder>` (outside the repository) is for measuring: F8 in the game's window, or a file named `dump` in that folder (its text is the dump's label; it is removed as it is seen), writes the first 0x4000 b... | +| `LEONIDA_PED_VEHICLE_AT` | see the code | | | | `leonida/player_context.rs` | What says "in a vehicle", the first of these that there is: - `LEONIDA_PED_VEHICLE_AT=0x<offset>`: a field of the player's ped that points at its vehicle and is null on foot (for a measured offset; none is known). - `LEO... | +| `LEONIDA_PIPELINE_BOOK` | see the code | | | | `leonida/main.rs` +2 | Every pipeline the title has ever created, kept on disk (`LEONIDA_PIPELINE_BOOK=1`), and their host pipelines made ahead of a run (`leonida warm`), so that the driver's own cache on disk has them before a draw asks for o... | +| `LEONIDA_PLAYER_ALIGN` | see the code | | | | `leonida/player_find.rs` | `LEONIDA_PLAYER_ALIGN` (4; 16 is faster), `LEONIDA_PLAYER_MAX_CANDIDATES` (6000000), `LEONIDA_PLAYER_MAX_TRACKS` (2000000), `LEONIDA_PLAYER_TOP` (100), `LEONIDA_PLAYER_GROUPS` (6), `LEONIDA_PLAYER_POINTERS=0` (no pointer... | +| `LEONIDA_PLAYER_F64` | see the code | | | | `leonida/player_find.rs` | ...g\|plain\|any\|off`) and triples of doubles in the map (`D3`, `LEONIDA_PLAYER_F64=0` to skip).... | +| `LEONIDA_PLAYER_FILTER` | see the code | | | | `leonida/player_find.rs` | `LEONIDA_PLAYER_FILTER=loose` turns the strict filters off (strict: a 4x4's w column exactly 0 and corner 1, a position that is not a whole number of metres on every axis, axes that are not exactly the world's); `summary... | +| `LEONIDA_PLAYER_GROUPS` | see the code | | | | `leonida/player_find.rs` | ..._PLAYER_MAX_TRACKS` (2000000), `LEONIDA_PLAYER_TOP` (100), `LEONIDA_PLAYER_GROUPS` (6), `LEONIDA_PLAYER_POINTERS=0` (no pointer search).... | +| `LEONIDA_PLAYER_IDLE_MAX` | see the code | | | | `leonida/player_find.rs` | A candidate dies when it moves while no key has been held for a second (more than `LEONIDA_PLAYER_IDLE_TOL` = 0.02 m, `LEONIDA_PLAYER_IDLE_MAX` = 2 times) or stops looking like a transform; the survivors that moved are r... | +| `LEONIDA_PLAYER_IDLE_TOL` | see the code | | | | `leonida/player_find.rs` | A candidate dies when it moves while no key has been held for a second (more than `LEONIDA_PLAYER_IDLE_TOL` = 0.02 m, `LEONIDA_PLAYER_IDLE_MAX` = 2 times) or stops looking like a transform; the survivors that moved are r... | +| `LEONIDA_PLAYER_INTERVAL_MS` | see the code | | | | `leonida/player_find.rs` | Then, for `<seconds>`, it reads every candidate's position every `LEONIDA_PLAYER_INTERVAL_MS` (250) together with the keys held at that moment (the file `LEONIDA_KEYS_FILE` names). | +| `LEONIDA_PLAYER_LEVELS` | see the code | | | | `leonida/player_find.rs` | ...ck holding such a pointer less than 0x1000 bytes in, up to `LEONIDA_PLAYER_LEVELS` (3) levels.... | +| `LEONIDA_PLAYER_MAX_CANDIDATES` | see the code | | | | `leonida/player_find.rs` | `LEONIDA_PLAYER_ALIGN` (4; 16 is faster), `LEONIDA_PLAYER_MAX_CANDIDATES` (6000000), `LEONIDA_PLAYER_MAX_TRACKS` (2000000), `LEONIDA_PLAYER_TOP` (100), `LEONIDA_PLAYER_GROUPS` (6), `LEONIDA_PLAYER_POINTERS=0` (no pointer... | +| `LEONIDA_PLAYER_MAX_TRACKS` | see the code | | | | `leonida/player_find.rs` | `LEONIDA_PLAYER_ALIGN` (4; 16 is faster), `LEONIDA_PLAYER_MAX_CANDIDATES` (6000000), `LEONIDA_PLAYER_MAX_TRACKS` (2000000), `LEONIDA_PLAYER_TOP` (100), `LEONIDA_PLAYER_GROUPS` (6), `LEONIDA_PLAYER_POINTERS=0` (no pointer... | +| `LEONIDA_PLAYER_PATHS` | see the code | | | | `leonida/player.rs` | ...tle's image to them (`%TEMP%\leonida-player\paths.txt`, or `LEONIDA_PLAYER_PATHS=<file>`); this reads that file and follows the paths at run time.... | +| `LEONIDA_PLAYER_POINTERS` | see the code | | | | `leonida/player_find.rs` | ..., `LEONIDA_PLAYER_TOP` (100), `LEONIDA_PLAYER_GROUPS` (6), `LEONIDA_PLAYER_POINTERS=0` (no pointer search).... | +| `LEONIDA_PLAYER_PROBE` | see the code | | | | `leonida/player_find.rs` | `LEONIDA_PLAYER_PROBE=<s>` starts it that many seconds after the title started, `LEONIDA_PLAYER_PROBE_MAX` (600) bounds the tries. | +| `LEONIDA_PLAYER_PROBE_MAX` | see the code | | | | `leonida/player_find.rs` | `LEONIDA_PLAYER_PROBE=<s>` starts it that many seconds after the title started, `LEONIDA_PLAYER_PROBE_MAX` (600) bounds the tries. | +| `LEONIDA_PLAYER_PROBE_SECONDS` | see the code | | | | `leonida/player_find.rs` | | +| `LEONIDA_PLAYER_PRUNE_STABLE` | see the code | | | | `leonida/player_find.rs` | A candidate that never moves once movement keys have been held for `LEONIDA_PLAYER_PRUNE_STABLE` (6) samples, or that jumps more than 25 m/s, is dropped. | +| `LEONIDA_PLAYER_THREADS` | see the code | | | | `leonida/player_find.rs` | The scan runs on `LEONIDA_PLAYER_THREADS` threads (default 8 at most). | +| `LEONIDA_PLAYER_TOP` | see the code | | | | `leonida/player_find.rs` | `LEONIDA_PLAYER_ALIGN` (4; 16 is faster), `LEONIDA_PLAYER_MAX_CANDIDATES` (6000000), `LEONIDA_PLAYER_MAX_TRACKS` (2000000), `LEONIDA_PLAYER_TOP` (100), `LEONIDA_PLAYER_GROUPS` (6), `LEONIDA_PLAYER_POINTERS=0` (no pointer... | +| `LEONIDA_PLAYER_VEC_W` | see the code | | | | `leonida/player_find.rs` | ... lie in the map and whose w is not a float in range (`V4`, `LEONIDA_PLAYER_VEC_W=flag\|plain\|any\|off`) and triples of doubles in the map (`D3`, `LEONIDA_PLAYER_F64=0` to skip).... | +| `LEONIDA_PLAYER_VEHICLE_AT` | see the code | | | | `leonida/player_context.rs` | ... is null on foot (for a measured offset; none is known). - `LEONIDA_PLAYER_VEHICLE_AT=0x<offset in the image>`: a global of the title that holds the player's vehicle and is null on foot.... | +| `LEONIDA_POKE` | see the code | | | | `leonida/run.rs` | `LEONIDA_POKE=<rva>:<byte>,...` (hex) writes the byte at each title+rva twice a second. | +| `LEONIDA_PORT_DESCRIPTORS` | see the code | | yes | yes | `leonida/run.rs` +4 | ...e, and the per-frame look at every changed heap page goes (`LEONIDA_PORT_DESCRIPTORS=1`, off by default; read in [`on`]).... | +| `LEONIDA_RDNA_FLOAT` | see the code | | | yes | `leonida/translate.rs` +1 | `LEONIDA_RDNA_FLOAT`: a set of [`rdna`]'s bits (decimal or `0x` hex); all of them when it is unset, `0` none. | +| `LEONIDA_RECORD` | see the code | | | | `leonida/replay.rs` +2 | On with `LEONIDA_RECORD=<folder>` only; without it nothing is hooked. | +| `LEONIDA_RELAY` | see the code | | | | `leonida/leonida.rs` +8 | The relay's first stage (`LEONIDA_RELAY=1`; off by default; it turns [`late`] on at stage 3 unless `LEONIDA_LATE_WAIT` says another stage, and is off with it, in the timing run and with kept snapshots). | +| `LEONIDA_RENDER_SCALE` | see the code | | | | `leonida/leonida.rs` +5 | The scale `LEONIDA_RENDER_SCALE` asks for, if valid. | +| `LEONIDA_SHADER_CENSUS` | see the code | | | yes | `leonida/translate.rs` +2 | `LEONIDA_SHADER_CENSUS=<file>`: one line per emitted program, appended: its label, the console program's instructions by encoding class (a static count of the whole program, not of one thread's path), and the host module... | +| `LEONIDA_SKIP_CPU_CHECK` | see the code | | | | `leonida/run.rs` | | +| `LEONIDA_TELEPORT` | see the code | | | | `leonida/player.rs` +1 | Nothing leaves the machine; nothing of the title is stored here. - `LEONIDA_TELEPORT=<delay s>,<x>,<y>,<z>[,<hold ms>]` teleports once, that many seconds after start (the menu's Teleport page and `leonida.teleport` do th... | +| `LEONIDA_TELEPORT_LIFT` | see the code | | | | `leonida/player.rs` | ...port page and `leonida.teleport` do the same on demand). - `LEONIDA_TELEPORT_LIFT=<metres>` is added to the target's z (a few metres above the ground, so a position slightly under it does not trap the player). - `LEONIDA... | +| `LEONIDA_TRANSLATE_ONLY` | see the code | | | | `leonida/translate.rs` | `LEONIDA_TRANSLATE_ONLY=<hash prefix>,...` translates those containers alone. | +| `LEONIDA_UPSCALE` | see the code | | | | `leonida/run.rs` +6 | `LEONIDA_UPSCALE=stretch\|dlss`: the upscale dispatch is ours (`leonida_hle::modules::ffx`: DLSS, or a plain stretch) instead of the title's own FidelityFX passes, which are slow translated on 32-lane hosts; the rest of t... | +| `LEONIDA_VICE_CITY` | see the code | | | | `leonida/player.rs` | ... a position slightly under it does not trap the player). - `LEONIDA_VICE_CITY=<x>,<y>,<z>` (or the file `vice.txt` beside the paths) is the place the menu's "To Vice City" item goes to.... | +| `LEONIDA_VIEW_LIMIT` | see the code | | | | `leonida/main.rs` | Set `LEONIDA_HOST_WAVE` and `LEONIDA_VIEW_LIMIT` to what the run's log says of the host. | +| `LEONIDA_WARM_DONE_ALL` | see the code | | | | `leonida/warm.rs` | `LEONIDA_WARM_DONE_ALL=1`, as before; unset or `0` (the default): only those that have one are done. | +| `LEONIDA_WARM_SECONDS` | see the code | | | | `leonida/translate.rs` | `LEONIDA_WARM_SECONDS=<n>`: stop taking new shaders after n seconds (what is done stays in the cache; the next warm-up goes on from there). | +| `LEONIDA_WATCH` | see the code | | | | `leonida/run.rs` | `LEONIDA_WATCH=<rva>,...` (hex) logs the u32 at each title+rva whenever it changes, polled every 5 ms (an engine's state, say). | +| `LEONIDA_WINDOWS_BUILD` | see the code | | | | `leonida/agility.rs` | `LEONIDA_WINDOWS_BUILD` stands in for it (to try Windows 10's path). | +| `LEONIDA_X` | see the code | | | | `leonida/leonida.rs` +1 | The `LEONIDA_` settings to set for the environment `vars`: one per `VICTORY_X` whose `LEONIDA_X` is not set. | + +## leonida-core + +| Name | Kind | A/B | L | F | Named in | In the code's words | +|---|---|---|---|---|---|---| +| `LEONIDA_CACHE_DIR` | see the code | | yes | | `leonida-core/config.rs` +2 | | +| `LEONIDA_CONFIG` | see the code | | | | `leonida-core/config.rs` +2 | Resolution order for each value: environment variable, then the config file (`LEONIDA_CONFIG`, else `./leonida.toml`), then the default. | +| `LEONIDA_DATA_DIR` | see the code | | | | `leonida-core/config.rs` +2 | | +| `LEONIDA_GAME_DIR` | see the code | | | | `leonida-core/config.rs` +6 | With `LEONIDA_GAME_DIR` set to the folder of the Xbox package: every place is in the code of `game_scarlett_master.exe` exactly once and points inside the image. | +| `LEONIDA_LOG` | see the code | | yes | | `leonida-core/logging.rs` +1 | Filter with `LEONIDA_LOG` (falls back to `RUST_LOG`), e.g. | +| `LEONIDA_TEST_TITLES` | see the code | | | | `leonida-core/config.rs` | | + +## leonida-gpu + +| Name | Kind | A/B | L | F | Named in | In the code's words | +|---|---|---|---|---|---|---| +| `LEONIDA_AB` | see the code | | | yes | `leonida-gpu/ab.rs` +34 | `LEONIDA_AB=<seconds>,<switch>[,<switch>..]`: every so many seconds, at a present, the next phase begins; switch number n is on in the phases whose number has bit n, so that all combinations come one after another, again... | +| `LEONIDA_ACTIVATE_RAYS` | see the code | | | | `leonida-gpu/pipeline/make.rs` +1 | | +| `LEONIDA_ADAPTER` | see the code | | | | `leonida-gpu/host.rs` +3 | LOCAL: the card `LEONIDA_ADAPTER` names, for a PC with more than one. | +| `LEONIDA_AHEAD_INDEX` | on, `0` turns it off | yes | | | `leonida-gpu/watch.rs` | Whether the page ranges asked ahead ([`Journal::ahead`]) are kept in order, so that the one that holds a range is found in a few steps (`LEONIDA_AHEAD_INDEX=0`: a list looked through from its start, as before). | +| `LEONIDA_AHEAD_SPLIT` | off unless set and not `0` | yes | yes | yes | `leonida-gpu/draw.rs` +1 | `LEONIDA_AHEAD_SPLIT=1`: the list ahead of a frame is recorded as two lists by two threads at once, the buffer views' pass and the textures' pass (sent in that order), instead of one after the other into one list. | +| `LEONIDA_ALIAS_CAST` | on, `0` turns it off | yes | | yes | `leonida-gpu/descriptor/host.rs` +2 | ..., with no copy on the card and no host texture of its own (`LEONIDA_ALIAS_CAST=0`: copied as before; `LEONIDA_AB` can name it).... | +| `LEONIDA_ALIAS_COPY` | see the code | | | | `leonida-gpu/resource.rs` | `LEONIDA_ALIAS_COPY=0`: none is found, as before; `=1`: only textures of one level and one layer, as at first. | +| `LEONIDA_ALIAS_COUNT` | off unless set and not `0` | | | | `leonida-gpu/texture.rs` | Whether the copies behind aliased views are counted by view, with how often each source is written (`LEONIDA_ALIAS_COUNT=1`, diagnostics; off by default: a lock for every change of a texture's state to a written one). | +| `LEONIDA_ALIAS_DIRECT` | off unless set and not `0` | yes | yes | yes | `leonida-gpu/resource.rs` +2 | ...wo formats ([`direct_pair`]), instead of through a buffer (`LEONIDA_ALIAS_DIRECT=1`; off by default: through the buffer, as before; `LEONIDA_AB` can name it).... | +| `LEONIDA_ALIAS_LATER` | on, `0` turns it off | yes | | | `leonida-gpu/queue.rs` | Whether the title's page-mapping copies are done by a thread of ours behind its call (`LEONIDA_ALIAS_LATER=0`: in the call, as before; needs the line of submissions). | +| `LEONIDA_ALIAS_QUICK` | off unless set and not `0` | yes | | yes | `leonida-gpu/resource.rs` | Off unless `LEONIDA_ALIAS_QUICK=1`; by turns under A/B. | +| `LEONIDA_ALLOCATOR_TRIM` | see the code | | | yes | `leonida-gpu/host.rs` +1 | Whether host command allocators are taken anew now and then (`LEONIDA_ALLOCATOR_TRIM=1`; off by default), and after how many seconds (`LEONIDA_ALLOCATOR_TRIM_S`, 30, 5 to 3600). | +| `LEONIDA_ALLOCATOR_TRIM_S` | see the code | | | | `leonida-gpu/host.rs` | Whether host command allocators are taken anew now and then (`LEONIDA_ALLOCATOR_TRIM=1`; off by default), and after how many seconds (`LEONIDA_ALLOCATOR_TRIM_S`, 30, 5 to 3600). | +| `LEONIDA_AMBIENT` | see the code | | | | `leonida-gpu/ambient.rs` +3 | `LEONIDA_AMBIENT`: - unset or `0`/`off`: the title's own output. - a number: that share of the estimate (1: all of it). - `constant:<level>`: the constant, as beloooo's fork has it. | +| `LEONIDA_AMBIENT_AIR` | see the code | | yes | | `leonida-gpu/ambient.rs` +2 | `LEONIDA_AMBIENT_AIR` bounds what the air scatters by a multiple of the light around. | +| `LEONIDA_AMBIENT_ALPHA` | see the code | yes | yes | | `leonida-gpu/ambient.rs` +1 | The most light transparent surfaces and particles get from around them, as a multiple of the light around (`LEONIDA_AMBIENT_ALPHA=<multiple>`; unset or 0: what the title has). | +| `LEONIDA_AMBIENT_FLOOR` | see the code | yes | | | `leonida-gpu/ambient.rs` | The least diffuse light the estimate gives (`LEONIDA_AMBIENT_FLOOR=<level>`, with `LEONIDA_AMBIENT` a number; unset or 0: no floor), a warm fill shaded in creases as the constant stand-in is. | +| `LEONIDA_AMBIENT_MAGENTA` | on, `0` turns it off | yes | | | `leonida-gpu/ambient.rs` | | +| `LEONIDA_AMBIENT_MOST` | see the code | | | | `leonida-gpu/ambient.rs` +1 | Fresh seconds (default 0: none): for that long after such a jump the light the title's own resolve left is bounded by the estimate, not `LEONIDA_AMBIENT_MOST` times it. | +| `LEONIDA_AMBIENT_ON` | on, `0` turns it off | yes | | | `leonida-gpu/ambient.rs` | `LEONIDA_AB=<s>,LEONIDA_AMBIENT_ON` measures what the passes cost on the card in one run (off: the title's shading as it is with the rays off); unset, as `LEONIDA_AMBIENT` says. | +| `LEONIDA_AMBIENT_SETTLE` | see the code | yes | | | `leonida-gpu/ambient.rs` | How the slow mean of the light around follows the frames (`LEONIDA_AMBIENT_SETTLE=<time constant in ms>[,<jump factor>[,<fresh seconds>]]`, or `LEONIDA_AMBIENT_SETTLE=1`: 250,3; unset or 0: 0.04 of the way a frame, as be... | +| `LEONIDA_AMBIENT_SHADE` | see the code | | | | `leonida-gpu/ambient.rs` | `LEONIDA_AMBIENT_SHADE=<strength>,<radius in metres>` sets the creases. | +| `LEONIDA_AMBIENT_TRUE_DEPTH` | see the code | | | | `leonida-gpu/ambient.rs` +1 | Whether the resolve's depth is looked for at [`TRUE_DEPTH`] first (`LEONIDA_AMBIENT_TRUE_DEPTH=1`; off by default: [`DEPTH`] alone, as before). | +| `LEONIDA_ASK_EARLY` | see the code | | | | `leonida-gpu/watch.rs` | Whether a thread asks, between a submission's askings, about the memory they found written (`LEONIDA_ASK_EARLY=<ms>` between its rounds; off unless given: in run cpu-2 the submissions' own askings were none the cheaper f... | +| `LEONIDA_ASK_GAP_KB` | see the code | yes | | | `leonida-gpu/watch.rs` | `LEONIDA_ASK_GAP_KB=<KiB>`, 8192 by default. | +| `LEONIDA_ASK_GAP_KB_AB` | see the code | | | yes | `leonida-gpu/watch.rs` | Named in `LEONIDA_AB`, the gap asked for against `LEONIDA_ASK_GAP_KB_AB` (256 when not set). | +| `LEONIDA_ASK_ONCE` | see the code | | | | `leonida-gpu/host.rs` +1 | Whether a submission asks the kernel once, before its first refresh, about every range its lists refresh (`LEONIDA_ASK_ONCE=1`; off by default). | +| `LEONIDA_ASK_RANGES` | on, `0` turns it off | yes | | | `leonida-gpu/watch.rs` | Whether an asking for a submission holds the page ranges it asks the kernel about and no others (`LEONIDA_ASK_RANGES=0`: all of memory, as before). [`ask_ahead`] and [`ask_rest`] held everything ([`Asking::hold_all`]) wh... | +| `LEONIDA_ASPECT` | see the code | | | | `leonida-gpu/aspect.rs` +4 | Two settings, the ones `docs/ultrawide.md` gives the Vulkan runtime: - `LEONIDA_ASPECT=21:9\|32:9\|16:9\|W:H\|<decimal>\|auto`: the shape the title's window is made in (`auto`: the primary monitor's). | +| `LEONIDA_ASYNC_SUBMIT` | see the code | yes | | yes | `leonida-gpu/queue.rs` +1 | Submissions prepared and sent by a thread of ours, in order, instead of by the thread of the title that submits them (`LEONIDA_ASYNC_SUBMIT=1`). | +| `LEONIDA_BACK_RENEW` | on, `0` turns it off | yes | | | `leonida-gpu/host.rs` +1 | `LEONIDA_BACK_RENEW=0`: a stale one is kept, as before. | +| `LEONIDA_BAKE_AHEAD` | see the code | | | yes | `leonida-gpu/draw.rs` | ...e air, waiting for the uploads and showing the slots then (`LEONIDA_BAKE_AHEAD=1`, or by turns with `LEONIDA_AB`; off by default).... | +| `LEONIDA_BAKE_EXACT` | see the code | | | | `leonida-gpu/draw.rs` | Whether a draw of the title's bake finds the textures it picks by index as title memory has them at that moment (`LEONIDA_BAKE_EXACT=0`: as the pass leaves them, as before). | +| `LEONIDA_BAKE_TEXTURES_MS` | see the code | | | | `leonida-gpu/draw.rs` | ...ay take just before a draw of the title's decoration bake (`LEONIDA_BAKE_TEXTURES_MS`, 1500; 0: nothing special).... | +| `LEONIDA_BARRIER_MERGE` | off unless set and not `0` | yes | | yes | `leonida-gpu/draw.rs` +1 | ... no command since that can write through unordered access (`LEONIDA_BARRIER_MERGE=1`; off by default; `LEONIDA_AB` can name it).... | +| `LEONIDA_BARRIER_TEST` | see the code | | | | `leonida-gpu/copystat.rs` +2 | Whether an experiment on barriers is on (`LEONIDA_BARRIER_TEST`): bit 0 for `groups` (the title's barrier groups record no wait for earlier shader writes), bit 1 for `indirect` (the pass that bounds an indirect command r... | +| `LEONIDA_BARRIER_WAITS` | on, `0` turns it off | yes | | | `leonida-gpu/copystat.rs` | `LEONIDA_AB=<s>,LEONIDA_BARRIER_WAITS` (off: both kinds of waits left out, as `both`). | +| `LEONIDA_BATCH_DESCRIPTORS` | see the code | | | yes | `leonida-gpu/descriptor/host.rs` +2 | ... table instead of one `CopyDescriptorsSimple` call a slot (`LEONIDA_BATCH_DESCRIPTORS=1`, or by turns with `LEONIDA_AB`; off by default).... | +| `LEONIDA_BATCH_KEPT` | on, `0` turns it off | yes | | yes | `leonida-gpu/host.rs` | (`LEONIDA_BATCH_KEPT`: read once, so that the whole submission goes one way while `LEONIDA_AB` flips it.) | +| `LEONIDA_BATCH_SCRATCH_POOL` | on, `0` turns it off | yes | | yes | `leonida-gpu/host.rs` | Whether the scratch buffers of the batched clamps ([`HostList::batch_place`]) are shared by the lists (`LEONIDA_BATCH_SCRATCH_POOL=0`: a list keeps every one it ever took for as long as it lives, as before; `LEONIDA_AB`... | +| `LEONIDA_BATCH_TEXTURE_DISPATCHES` | on, `0` turns it off | yes | | | `leonida-gpu/draw.rs` | `LEONIDA_BATCH_TEXTURE_DISPATCHES=0`: every dispatch ends the batch, as before (an A/B switch, `LEONIDA_AB`). | +| `LEONIDA_BATCH_WHY` | off unless set and not `0` | | | yes | `leonida-gpu/draw.rs` +1 | `LEONIDA_BATCH_WHY=1` counts what ends indirect batches and by which programs' declared ranges ([`batch_why_line`]). | +| `LEONIDA_BENCH_CS` | see the code | | | | `leonida-gpu/indirect.rs` | `LEONIDA_BENCH_CS=<file>` times another source of the shader. | +| `LEONIDA_BENCH_N` | see the code | | | | `leonida-gpu/indirect.rs` | `LEONIDA_BENCH_N` runs of each, 3). | +| `LEONIDA_BENCH_S` | see the code | | | | `leonida-gpu/indirect.rs` | Whether the card can read a texture's descriptor half written (ignored: a measurement of the card, `LEONIDA_BENCH_S` seconds a way, 5). | +| `LEONIDA_BENCH_THREADS` | see the code | | | | `leonida-gpu/indirect.rs` | Threads (`LEONIDA_BENCH_THREADS`, 4) make blocks of 64 MiB, a texture in each and its view, and copies the view into a slot; long dispatches that read all the slots are always on the card. | +| `LEONIDA_BENCH_WARP` | see the code | | | | `leonida-gpu/indirect.rs` | | +| `LEONIDA_BIND_CACHE` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_BIND_CACHE=0` sets them every time. | +| `LEONIDA_BLOCK_WAY` | see the code | | | | `leonida-gpu/indirect.rs` | | +| `LEONIDA_BOOK` | see the code | | | | `leonida-gpu/book.rs` | `LEONIDA_BOOK=0` keeps none. | +| `LEONIDA_BURY_LAG` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_BURY_LAG=0`: not. | +| `LEONIDA_BVH_BOUNDS` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | Whether the structure builder's accesses through its root views stay near them, and a size in a structure's header that cannot be one counts as none (`LEONIDA_BVH_BOUNDS=0`: neither). | +| `LEONIDA_BVH_BUILDER` | see the code | | | | `leonida-gpu/fg.rs` +6 | ... for the rest of the run at first. shortcut: and only with `LEONIDA_BVH_BUILDER=1`, until a run has shown the whole builder and the host side of title memory by address (`memory.rs`) working on a card; nothing reads the... | +| `LEONIDA_BVH_FENCES` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | Whether buffer atomics of the ray-tracing structure builder stand between two fences (`LEONIDA_BVH_FENCES=0`: they do not). | +| `LEONIDA_BVH_MISS` | see the code | | | | `leonida-gpu/pipeline/make.rs` +2 | With every ray a miss (`LEONIDA_BVH_MISS=1`) the tiles they trace come out lit: in the fork, stair-stepped sun patches on walls and clothes and hair glowing in the sun. | +| `LEONIDA_BVH_QUARANTINE` | see the code | | | | `leonida-gpu/pipeline.rs` | `LEONIDA_BVH_QUARANTINE=1`: what the structure builder's stages store stays in the host's copies and is not copied back into title memory. | +| `LEONIDA_BVH_SIZES_WAIT` | see the code | | | | `leonida-gpu/memory.rs` | Whether a submission that asks for the sizes of structures is waited for, and landed, before the title goes on (`LEONIDA_BVH_SIZES_WAIT=1`; off). | +| `LEONIDA_BVH_TRACE` | see the code | | | | `leonida-gpu/memory.rs` | `LEONIDA_BVH_TRACE=1`: the sizes the builder is asked for (its program of one thread that stores a structure's compacted size) and when title memory has them, and the copies to a place of that size. | +| `LEONIDA_CAPTURE` | see the code | | yes | | `leonida-gpu/capture.rs` +2 | Presented frames written to PNG files, to see what reaches the screen: with `LEONIDA_CAPTURE=<folder>`, every frame whose number is a power of two (the frames the log reports) is saved as `frame-<n>.png`, at half size. | +| `LEONIDA_CAPTURE_ALL` | see the code | | | | `leonida-gpu/capture.rs` | `LEONIDA_CAPTURE_ALL=1`: every frame for as long as the title runs. | +| `LEONIDA_CAPTURE_FRAMES` | see the code | | | | `leonida-gpu/capture.rs` | Frames listed in `LEONIDA_CAPTURE_FRAMES` (comma-separated): saved too, and their draws traced at debug level. | +| `LEONIDA_CAPTURE_WORLD` | see the code | | | | `leonida-gpu/capture.rs` | `LEONIDA_CAPTURE_WORLD`: also the 2nd and the 6th frame after the first one that ran 500 draws or more (a title's first 3D frames: their numbers depend on how long the menus were shown), and the 30th and the 80th (the ti... | +| `LEONIDA_CAPTURE_WORLD_ALSO` | see the code | | | | `leonida-gpu/capture.rs` | `LEONIDA_CAPTURE_WORLD_ALSO` (comma-separated): more frames counted from that first one (the title's blue patches show from about the 118th frame on, when the window's model has arrived and the reflections hold values: n... | +| `LEONIDA_CARD_ACCOUNTING` | see the code | | | | `leonida-gpu/draw.rs` +1 | Off unless `LEONIDA_CARD_ACCOUNTING=1`; then at the first pass that finds the card without room, and every five seconds after it. | +| `LEONIDA_CARD_ALL` | see the code | | | | `leonida-gpu/host/place.rs` +2 | One in the card's memory, one in the PC's (one side without `LEONIDA_CARD_ALL`). | +| `LEONIDA_CARD_BUFFERS` | see the code | | | | `leonida-gpu/shadow.rs` | `LEONIDA_CARD_BUFFERS=0` keeps every copy in the PC's memory, as before. | +| `LEONIDA_CARD_BUFFERS_MB` | see the code | | | | `leonida-gpu/host/menu.rs` +2 | Resolve `(min_bytes, max_bytes)` from the adapter's local VRAM budget and optional explicit MiB overrides from `LEONIDA_CARD_BUFFERS_MIN_MB` / `LEONIDA_CARD_BUFFERS_MB`. | +| `LEONIDA_CARD_BUFFERS_MIN_KB` | see the code | | | yes | `leonida-gpu/shadow.rs` +1 | With the title's buffers of a megabyte and more on the card that is a hundred copies; with the small ones too (`LEONIDA_CARD_BUFFERS_MIN_KB=64`) it was 3,540 copies times 29 submissions, 2.4 ms a frame of the submitting... | +| `LEONIDA_CARD_BUFFERS_MIN_MB` | see the code | | yes | | `leonida-gpu/shadow.rs` +1 | Resolve `(min_bytes, max_bytes)` from the adapter's local VRAM budget and optional explicit MiB overrides from `LEONIDA_CARD_BUFFERS_MIN_MB` / `LEONIDA_CARD_BUFFERS_MB`. | +| `LEONIDA_CARD_COMPARE_JOIN` | on, `0` turns it off | yes | | | `leonida-gpu/host.rs` | Whether the compares of ranges of one copy in the card's memory whose pieces and result places follow each other go in one pass (`LEONIDA_CARD_COMPARE_JOIN=0`: a pass each, as before). | +| `LEONIDA_CARD_HASH_LEN` | see the code | | | | `leonida-gpu/shadow.rs` | `LEONIDA_CARD_HASH_LEN=0`: the whole buffer. | +| `LEONIDA_CARD_QUEUE` | on, `0` turns it off | yes | | | `leonida-gpu/shadow.rs` | Whether [`card_dirty`] takes the copies that changed from that queue (`LEONIDA_CARD_QUEUE=0`: it goes through every copy in the card's memory, as before). | +| `LEONIDA_CARD_REHASH_RUNS` | see the code | | | | `leonida-gpu/host.rs` +3 | ... are hashed in runs of pieces that touch, each piece once (`LEONIDA_CARD_REHASH_RUNS=1`; off by default), and not in a pass per range sent up.... | +| `LEONIDA_CARD_RESERVE_BUDGETS` | see the code | | | yes | `leonida-gpu/shadow.rs` | Whether the texture queue keeps the card room of the budgets as they are set, and windows go to the card up to the line title buffers do (`LEONIDA_CARD_RESERVE_BUDGETS=1`; off by default: unset or anything else is as bef... | +| `LEONIDA_CARD_ROOM_FOR_BUFFERS` | see the code | | | | `leonida-gpu/shadow.rs` | Whether the texture queue leaves room on the card for the card copies of title buffers that are not made yet (`LEONIDA_CARD_ROOM_FOR_BUFFERS=1`; off by default). | +| `LEONIDA_CARD_ROOM_FOR_TARGETS_MB` | see the code | | | | `leonida-gpu/resource.rs` | `LEONIDA_CARD_ROOM_FOR_TARGETS_MB` (3,072; 0: none, as before) less what such copies hold now. | +| `LEONIDA_CARD_SPANS` | see the code | | | | `leonida-gpu/host/spans.rs` | Diagnostics: how long the card itself works on our submissions, by its own timestamps (`LEONIDA_CARD_SPANS=1`). | +| `LEONIDA_CARD_STEPS` | see the code | | | | `leonida-gpu/host/card_steps.rs` +3 | Steps of a submission that read title memory flights in the air may still write, done on the card in the flights' order instead of on the CPU after a wait for them (`LEONIDA_CARD_STEPS`, see [`stage`]). | +| `LEONIDA_CARD_STEPS_ON` | on, `0` turns it off | yes | | | `leonida-gpu/host/card_steps.rs` | `LEONIDA_AB=<s>,LEONIDA_CARD_STEPS_ON` measures what the planning costs against what it saves (off: no plan, the old wait for the flights where a step reads what they write). | +| `LEONIDA_CARD_WINDOWS_MB` | see the code | | | yes | `leonida-gpu/shadow.rs` | ... says 1,536), and nothing for the windows outside buffers (`LEONIDA_CARD_WINDOWS_MB`, [`window_card_most`]), which are turned down from eight tenths of the card's budget on ([`window_room_for`]).... | +| `LEONIDA_CLAIM_READ_FIRST` | on, `0` turns it off | yes | | | `leonida-gpu/texture.rs` | A change after the load is claimed by the next list. LEONIDA_CLAIM_READ_FIRST=0 restores the swaps. | +| `LEONIDA_CLOSED_AHEAD` | on, `0` turns it off | yes | | yes | `leonida-gpu/list.rs` | `LEONIDA_CLOSED_AHEAD=0`: closed there, as before. | +| `LEONIDA_COMMITTED_QUERY` | see the code | | | | `leonida-gpu/texture.rs` | Whether the two questions above and below are put to `VirtualQuery`, as they were (`LEONIDA_COMMITTED_QUERY=1`). | +| `LEONIDA_COMMIT_FLOOR` | see the code | yes | | yes | `leonida-gpu/resource.rs` | `LEONIDA_COMMIT_FLOOR=1` (off by default; `LEONIDA_AB` can name it), and less left than `LEONIDA_COMMIT_FLOOR_MB` megabytes (4096 where it is unset: where `crate::residency` begins to speak of pressure by commit). | +| `LEONIDA_COMMIT_FLOOR_MB` | see the code | | | yes | `leonida-gpu/resource.rs` | `LEONIDA_AB` can name it), and less left than `LEONIDA_COMMIT_FLOOR_MB` megabytes (4096 where it is unset: where `crate::residency` begins to speak of pressure by commit). | +| `LEONIDA_COMPOSE_NAN` | see the code | | | | `leonida-gpu/compose.rs` | A clamp to [0,1] that is safe for NaN and infinity (CLEAN, set when the pass is made from LEONIDA_COMPOSE_NAN): saturate() makes a NaN 0, which showed as black specks and a black sun where the upscaler or frame generatio... | +| `LEONIDA_CONSTANT_MARKS` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | `LEONIDA_CONSTANT_MARKS=1` turns it on. | +| `LEONIDA_CONTENT_TABLES` | off unless set and not `0` | yes | | yes | `leonida-gpu/draw.rs` | Off unless `LEONIDA_CONTENT_TABLES=1`; by turns under A/B. | +| `LEONIDA_COPIES_IN_PLACE` | see the code | | | | `leonida-gpu/host/place.rs` | The title's buffer copies, done on the card at their place in the list (`LEONIDA_COPIES_IN_PLACE`, on by default; `0`: all at submission, on the CPU, as before). | +| `LEONIDA_COPYBACK_ELIDE` | see the code | | | yes | `leonida-gpu/shadow.rs` +1 | Copy-back elision (`LEONIDA_COPYBACK_ELIDE`): a big host copy in the card's memory that only the card ever changes is not copied back into title memory. | +| `LEONIDA_COPYBACK_ELIDE_MIN_MB` | see the code | | | | `leonida-gpu/shadow/elide.rs` | The smallest copy that is watched (`LEONIDA_COPYBACK_ELIDE_MIN_MB`, 4: a small buffer is the likely read back or query result). | +| `LEONIDA_COPY_ASK` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_COPY_ASK=1` asks first, as before. | +| `LEONIDA_COPY_BACK` | on, `0` turns it off | yes | | yes | `leonida-gpu/host.rs` +2 | Copies and resolves into textures the title fills go back the same way (`LEONIDA_COPY_BACK`; `0`: they stay on the host, as before): the title streams the small levels of a texture into memory by a copy, then samples the... | +| `LEONIDA_COPY_BESIDE` | see the code | yes | | yes | `leonida-gpu/titlewrite.rs` | ...`]: the title's `memcpy`, `memmove` and `memset` are ours (`LEONIDA_COPY_BESIDE=1`; off unless asked for).... | +| `LEONIDA_COPY_CLIP` | see the code | | | | `leonida-gpu/list.rs` | `LEONIDA_COPY_CLIP=0`: passed on whole, as before). | +| `LEONIDA_COPY_MODE` | see the code | | | | `leonida-gpu/copystat.rs` | `LEONIDA_COPY_MODE=plain` copies without the mapped-page guard, `none` skips the copies (both for timing only). | +| `LEONIDA_COPY_OVER_TITLE` | see the code | | | | `leonida-gpu/list.rs` | The first copy into a texture of the title's: what it does not write is zeros, as in a texture that was an allocation of its own (`LEONIDA_COPY_OVER_TITLE=title`: what title memory holds, which may be another texture's:... | +| `LEONIDA_COPY_SCOPED` | see the code | yes | yes | yes | `leonida-gpu/host.rs` +1 | ...t its place and wherever else the title shows their pages (`LEONIDA_COPY_SCOPED=1`; off by default; `LEONIDA_AB` can name it).... | +| `LEONIDA_CUT_WAITS` | see the code | | | | `leonida-gpu/queue.rs` | `LEONIDA_CUT_WAITS=0` holds whole lists, as before. | +| `LEONIDA_CUT_WRITES` | see the code | | | | `leonida-gpu/list.rs` | The title wrote a value at the bottom of the pipe (not a timestamp, not a query result): listed (diagnostics), and with `LEONIDA_CUT_WRITES=1` the host list is cut right behind it, so that the value is stored when the ca... | +| `LEONIDA_D3D12_BACKGROUND` | see the code | | | yes | `leonida-gpu/host.rs` | `LEONIDA_D3D12_BACKGROUND=0`: the runtime's background work (the driver compiling shaders again on the "D3D Background Thread"s, for minutes after pipelines were made or loaded) is switched off. | +| `LEONIDA_D3D12_DEBUG` | off unless set and not `0` | | | | `leonida-gpu/host.rs` +7 | With `LEONIDA_D3D12_DEBUG` set (diagnostics builds): the debug layer's messages. | +| `LEONIDA_D3D12_GBV` | off unless set and not `0` | | | | `leonida-gpu/host.rs` | GPU-based validation (`LEONIDA_D3D12_GBV`): out-of-range descriptor heap indices and the like become messages naming the command instead of page faults. | +| `LEONIDA_D3D12_WARP` | off unless set and not `0` | | | | `leonida-gpu/host.rs` +2 | A switch used to be on whenever its variable existed, so `LEONIDA_D3D12_WARP=0` (typed to switch it off, or left over from comparing two runs) still selected the software adapter. | +| `LEONIDA_DECLARE_ONCE` | see the code | | | | `leonida-gpu/host.rs` | Declared once until the list next writes title memory (but with `LEONIDA_DECLARE_ONCE=0`): the dispatches of a frame declared the same ranges thousands of times, each a step of its own. | +| `LEONIDA_DEPTH_TWINS` | see the code | | | | `leonida-gpu/resource.rs` | `LEONIDA_DEPTH_TWINS=0` makes none (such views stay null), `LEONIDA_DEPTH_TWINS=stencil` only those of formats with a stencil plane, `LEONIDA_DEPTH_TWINS=nodepth` none for the depth planes of such formats. | +| `LEONIDA_DIRECT_WRITES` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_DIRECT_WRITES=0` writes as before. | +| `LEONIDA_DISPLAY_MODE` | see the code | | | | `leonida-gpu/dxgi.rs` | `LEONIDA_DISPLAY_MODE=WxH` if set (as a console reports the television it is plugged into: a Series X on a 1080p set lists a 1080p mode), else 3840x2160. shortcut: not yet the host display's own size by default; make it... | +| `LEONIDA_DLSS_DEPTH_INVERTED` | see the code | | | | `leonida-gpu/dlss.rs` | ...`, `LEONIDA_DLSS_HDR=0\|1` (default: by the colour format), `LEONIDA_DLSS_DEPTH_INVERTED=0\|1` (default: by near > far), `LEONIDA_DLSS_SHARPNESS=<0..1>`.... | +| `LEONIDA_DLSS_DIR` | see the code | | | | `leonida-gpu/dlss.rs` +2 | `include`, `lib/Windows_x86_64`) is not part of this repository: the build links `nvsdk_ngx_d.lib` from `LEONIDA_DLSS_SDK`, and `nvngx_dlss.dll` is looked for in `LEONIDA_DLSS_DIR` (else beside the executable). | +| `LEONIDA_DLSS_HDR` | see the code | | | | `leonida-gpu/dlss.rs` | `LEONIDA_RENDER_SCALE`), `LEONIDA_DLSS_MV_SIGN=-1` (motion vectors the other way), `LEONIDA_DLSS_JITTER_SIGN=-1`, `LEONIDA_DLSS_HDR=0\|1` (default: by the colour format), `LEONIDA_DLSS_DEPTH_INVERTED=0\|1` (default: by nea... | +| `LEONIDA_DLSS_JITTER_SIGN` | see the code | | | | `leonida-gpu/dlss.rs` | `LEONIDA_RENDER_SCALE`), `LEONIDA_DLSS_MV_SIGN=-1` (motion vectors the other way), `LEONIDA_DLSS_JITTER_SIGN=-1`, `LEONIDA_DLSS_HDR=0\|1` (default: by the colour format), `LEONIDA_DLSS_DEPTH_INVERTED=0\|1` (default: by nea... | +| `LEONIDA_DLSS_MV_SIGN` | see the code | | | | `leonida-gpu/dlss.rs` | `LEONIDA_RENDER_SCALE`), `LEONIDA_DLSS_MV_SIGN=-1` (motion vectors the other way), `LEONIDA_DLSS_JITTER_SIGN=-1`, `LEONIDA_DLSS_HDR=0\|1` (default: by the colour format), `LEONIDA_DLSS_DEPTH_INVERTED=0\|1` (default: by nea... | +| `LEONIDA_DLSS_PRESET` | see the code | | | | `leonida-gpu/dlss.rs` +1 | `LEONIDA_DLSS_PRESET=J\|K\|L\|M`: the model, for every mode (unset: the DLL's default; 310.9.16 uses K, the DLSS 4 transformer model, for Quality). | +| `LEONIDA_DLSS_QUALITY` | see the code | | | | `leonida-gpu/dlss.rs` | `LEONIDA_DLSS_QUALITY` (0 performance, 1 balanced, 2 quality, 3 ultra performance, 5 DLAA; unset: by the sizes, `crate::list::dlss_mode`, which the render scale decides: `LEONIDA_RENDER_SCALE`), `LEONIDA_DLSS_MV_SIGN=-1`... | +| `LEONIDA_DLSS_SDK` | see the code | | | | `leonida-gpu/build.rs` +2 | The `dlss` feature links the DLSS SDK's loader (`nvsdk_ngx_d.lib`, the dynamic-CRT one) from `LEONIDA_DLSS_SDK`. | +| `LEONIDA_DLSS_SHARPNESS` | see the code | | | | `leonida-gpu/dlss.rs` +3 | ...LEONIDA_DLSS_DEPTH_INVERTED=0\|1` (default: by near > far), `LEONIDA_DLSS_SHARPNESS=<0..1>`.... | +| `LEONIDA_DUMP_SIZE` | see the code | | | yes | `leonida-gpu/capture.rs` | The sizes of the targets saved (`LEONIDA_DUMP_SIZE=<w>x<h>[,<w>x<h>..]`; unset: every size): a frame renders some 380 targets, 61 of them at the screen's size, and saving all of them took 11 s a frame, so a run of frames... | +| `LEONIDA_DUMP_TARGETS` | off unless set and not `0` | | yes | yes | `leonida-gpu/capture.rs` +1 | LOCAL: with a capture folder, F9 captures the next frame as a listed one (its picture, its ops and, with LEONIDA_DUMP_TARGETS=1, every target it drew): to catch a picture fault the moment it shows. | +| `LEONIDA_DUMP_VOLUMES` | off unless set and not `0` | | | | `leonida-gpu/capture.rs` | With `LEONIDA_DUMP_VOLUMES` set (and `LEONIDA_CAPTURE=<folder>`): the first time each 33x33x33 or 64x64x64 R16G16B16A16_FLOAT 3D texture is sampled by a list, and again [`VOLUME_AGAIN`] frames later, its texels are read... | +| `LEONIDA_DYNAMIC_BITS` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor.rs` +1 | Whether free dynamic slots are searched for a word of the set at a time, and a list's tables given back under one taking of the locks (`LEONIDA_DYNAMIC_BITS=0`: the search looks at slot after slot and each table is given... | +| `LEONIDA_DYNAMIC_LEASE` | see the code | | | | `leonida-gpu/descriptor/host.rs` | Whether dynamic slots come out of per-thread leases (`LEONIDA_DYNAMIC_LEASE=0`: one search under the lock each, as before). | +| `LEONIDA_DYNAMIC_SLOTS` | see the code | | yes | | `leonida-gpu/descriptor/host.rs` +2 | `LEONIDA_DYNAMIC_SLOTS` sets the most). 2^18 ran out in the title's bigger places (session play-1125-0127: 27,000 to 35,000 tables a frame, up to 3,285 of them refused, with 2,639 indirect draws and dispatches). | +| `LEONIDA_DYNAMIC_WAIT` | see the code | yes | | | `leonida-gpu/host.rs` | (Counts the wait, and with `LEONIDA_DYNAMIC_WAIT=1` waits for the next landing without the submission lock before it settles everything.) | +| `LEONIDA_E5_TARGETS` | see the code | | | | `leonida-gpu/resource.rs` | R16G16B16A16_FLOAT (10), 64 bits a texel, or with `LEONIDA_E5_TARGETS=r11g11b10` R11G11B10_FLOAT (26): 32 bits a texel as on the console, unsigned and without alpha as R9G9B9E5 is, with 6, 6 and 5 bits of mantissa agains... | +| `LEONIDA_EARLY_ALL` | see the code | | | | `leonida-gpu/pipeline/known.rs` +1 | `LEONIDA_EARLY_ALL=1`: every title pipeline is started at creation, requested before or not, so that the driver's own cache holds it for later runs. | +| `LEONIDA_EARLY_DEPTH` | see the code | | yes | yes | `leonida-gpu/queue.rs` +3 | `LEONIDA_EARLY_DEPTH=1` (off unless asked for): a pixel program whose console code tests depth and stencil before it runs ([`DEPTH_BEFORE_SHADER`]) gets D3D12's early depth-stencil test too (the DXIL shader flag ForceEar... | +| `LEONIDA_EARLY_TEXTURES_MS` | see the code | | | | `leonida-gpu/draw.rs` | The milliseconds of every frame the pass that uploads textures picked by index takes before a shader that picks by index has asked for it (`LEONIDA_EARLY_TEXTURES_MS`, 12; 0: never, as before), and the milliseconds it ma... | +| `LEONIDA_ENTRY_ONCE` | on, `0` turns it off | yes | | yes | `leonida-gpu/draw.rs` | `LEONIDA_ENTRY_ONCE=0`: every entry is brought up to date at every draw, as before; by turns under A/B. | +| `LEONIDA_EXACT_BACK` | see the code | | | | `leonida-gpu/shadow.rs` | Whether what shaders wrote goes into title memory run by run ([`put_changed`]; on by default, `LEONIDA_EXACT_BACK=0` writes the whole stretch from the first changed byte to the last, as before). | +| `LEONIDA_EXCHANGE_SITES` | see the code | | | yes | `leonida-gpu/shader_cache.rs` +1 | How many exchanges of a console wave64 program in two host waves get dwords of their own (`LEONIDA_EXCHANGE_SITES`, 24 unless set; 0: all share one pair, as before). | +| `LEONIDA_EXP_BATCH_NO_WAIT` | see the code | yes | | | `leonida-gpu/indirect.rs` +1 | Timing experiments (`LEONIDA_AB=<s>,LEONIDA_EXP_BATCH_NO_WAIT` and `..._WAIT_SOURCES`): nothing, or only the unordered access to the buffers the records are read from. | +| `LEONIDA_EXP_BATCH_WAIT_SOURCES` | see the code | yes | | | `leonida-gpu/indirect.rs` | | +| `LEONIDA_EXP_EMPTY_DISPATCHES` | see the code | | | | `leonida-gpu/indirect/batch.rs` | ...e), `LEONIDA_EXP_EMPTY_DRAWS` (bit 1: draws of no vertex), `LEONIDA_EXP_EMPTY_DISPATCHES` (bit 2: indirect dispatches of no group; what the title's compute passes make is stale or missing).... | +| `LEONIDA_EXP_EMPTY_DRAWS` | see the code | | | | `leonida-gpu/indirect/batch.rs` | `LEONIDA_EXP_EMPTY_MESH` (bit 0: mesh dispatches of no group; the world's geometry is gone), `LEONIDA_EXP_EMPTY_DRAWS` (bit 1: draws of no vertex), `LEONIDA_EXP_EMPTY_DISPATCHES` (bit 2: indirect dispatches of no group;... | +| `LEONIDA_EXP_EMPTY_INDIRECT` | see the code | yes | | yes | `leonida-gpu/draw.rs` | A buffer of 256 zeros on the card, for the empty indirect executions of `LEONIDA_EXP_EMPTY_INDIRECT` ([`State::execute_indirect`]). | +| `LEONIDA_EXP_EMPTY_MESH` | see the code | | | | `leonida-gpu/indirect/batch.rs` | `LEONIDA_EXP_EMPTY_MESH` (bit 0: mesh dispatches of no group; the world's geometry is gone), `LEONIDA_EXP_EMPTY_DRAWS` (bit 1: draws of no vertex), `LEONIDA_EXP_EMPTY_DISPATCHES` (bit 2: indirect dispatches of no group;... | +| `LEONIDA_EXP_MESH_ONE_PIXEL` | see the code | yes | | | `leonida-gpu/draw.rs` | `LEONIDA_EXP_MESH_SKIP` (what the mesh draws cost the card in all) and `LEONIDA_EXP_MESH_ONE_PIXEL` (what is left of it without their pixels: the mesh programs' own share). | +| `LEONIDA_EXP_MESH_SKIP` | see the code | yes | | yes | `leonida-gpu/draw.rs` | `LEONIDA_EXP_MESH_SKIP` (what the mesh draws cost the card in all) and `LEONIDA_EXP_MESH_ONE_PIXEL` (what is left of it without their pixels: the mesh programs' own share). | +| `LEONIDA_EXP_NO_ALIAS_COPY` | see the code | yes | | yes | `leonida-gpu/texture.rs` | Timing experiment (`LEONIDA_AB=<s>,LEONIDA_EXP_NO_ALIAS_COPY`): no copy is recorded while it is on (the views show what they were last given), so a phase's frame time against the next one's says what the copies cost the... | +| `LEONIDA_EXP_NO_PIXELS` | see the code | yes | | | `leonida-gpu/draw.rs` | Timing experiment (`LEONIDA_AB=<s>,LEONIDA_EXP_NO_PIXELS`): every scissor is empty while it is on, so the title's draws run their vertex and mesh programs and shade no pixel: a phase's frame time against the next one's i... | +| `LEONIDA_F16_NEAREST` | see the code | | | | `leonida-gpu/shader_cache.rs` +2 | `LEONIDA_F16_NEAREST=1`: the results of 16-bit float operations (`v_add_f16`, `v_mul_f16`, `v_cvt_f16_f32` ...) are rounded to nearest as the console rounds them ([`Lower::f16_nearest`]) instead of as the host's `f32tof1... | +| `LEONIDA_FAIR_DUE` | see the code | | | | `leonida-gpu/descriptor/host.rs` | Whether due texture slots are served in turns, a slot looked at before and one never looked at ([`TextureQueue::due`]; on unless `LEONIDA_FAIR_DUE=0`). | +| `LEONIDA_FAST_CORES` | see the code | | | | `leonida-gpu/cores.rs` | `LEONIDA_FAST_CORES`: 0: no thread asks; 1: the threads a frame waits for one by one; 2 (the default): the threads they share their work with too; 3: those that work beside the rest as well (lists translated, descriptors... | +| `LEONIDA_FAULT_BOOK` | see the code | | | | `leonida-gpu/faultbook.rs` | A book of the title's write faults on guarded view memory (`LEONIDA_FAULT_BOOK=<file>`; builds with diagnostics): which block, when in the frame, what it waited for, and what else happened to the block (taken by a refres... | +| `LEONIDA_FAULT_BOOK_AT` | see the code | | | | `leonida-gpu/faultbook.rs` | ...efresh, asked about), for 40 frames from each of the times `LEONIDA_FAULT_BOOK_AT` gives (seconds after the start; 150,210,270 unless given).... | +| `LEONIDA_FENCE_CHECK` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_FENCE_CHECK=0`: goes on, as before. | +| `LEONIDA_FETCH_CHECK` | see the code | | yes | | `leonida-gpu/host/menu.rs` +3 | Pieces of card copies that came down while a later flight was writing them (`LEONIDA_FETCH_CHECK`, with `LEONIDA_RELAY_COPY`). | +| `LEONIDA_FG_GBUFFER` | see the code | | | yes | `leonida-gpu/fg.rs` +1 | Whether the G-buffer pass's depth and velocity targets are frame generation's inputs where no upscale hands any over (`LEONIDA_FG_GBUFFER=0`: not, as before). | +| `LEONIDA_FG_HUDLESS` | see the code | | | | `leonida-gpu/fg.rs` | `LEONIDA_FG_HUDLESS`, on, `0` off): the picture without the interface. | +| `LEONIDA_FG_LIMIT_FPS` | see the code | | | | `leonida-gpu/fg.rs` +1 | `LEONIDA_FG_LIMIT_FPS=<n>`: Reflex holds the frames **shown** to n a second (its frame limit, `frameLimitUs`), so that they come evenly; unset or 0: no limit, as before. | +| `LEONIDA_FG_MARKERS` | see the code | | | | `leonida-gpu/fg.rs` +3 | `INTERFACE_COMPOSITE`, `before_target_draw`, `hudless_for`). - With `LEONIDA_FG_MARKERS=1`, Reflex's frames at the title's own events ([`frame_begins`], [`title_submits`], [`title_presents`]): its sleep where the title b... | +| `LEONIDA_FG_REFLEX` | see the code | | | | `leonida-gpu/fg.rs` | `LEONIDA_FG_REFLEX=0`: Reflex left off and its sleep not taken (to tell its cost from the rest). | +| `LEONIDA_FG_WITH_RT` | see the code | | | | `leonida-gpu/fg.rs` +1 | `LEONIDA_FG_WITH_RT=1` starts it anyway. | +| `LEONIDA_FIDELITYFX_DIR` | see the code | | | | `leonida-gpu/fsr.rs` +1 | ... the swap chain stays FidelityFX's until the next start. - `LEONIDA_FIDELITYFX_DIR`: the folder of AMD's signed `amd_fidelityfx_loader_dx12.dll` and `amd_fidelityfx_framegeneration_dx12.dll` (the FidelityFX SDK's `bin`;... | +| `LEONIDA_FILL_TITLE` | see the code | yes | yes | | `leonida-gpu/host.rs` +2 | Whether a small fill of upload memory, or copy of a title buffer, goes on without waiting for flights when the title itself wrote the memory since they were given it (`LEONIDA_FILL_TITLE=1`; off by default). | +| `LEONIDA_FIRSTLANE_OWN` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | `LEONIDA_FIRSTLANE_OWN=1` takes the host wave's own first lane, exact when the value is the same in every lane of the console wave (the ray-tracing builder's scans read a sum of scalars this way, inside a loop whose exit... | +| `LEONIDA_FIRST_HALF` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | Runs `translate` with first halves of interpolations evaluated as the pair they start: the translation of a program refused with [`FIRST_HALF`] (`LEONIDA_FIRST_HALF=0`: refused again, as before). | +| `LEONIDA_FPS_CAP` | see the code | | | | `leonida-gpu/frame.rs` +6 | `LEONIDA_FPS_CAP`. | +| `LEONIDA_FPS_LINE` | see the code | | | | `leonida-gpu/host/menu.rs` | Whether the frame-rate line is shown at the top while the menu is closed (`LEONIDA_FPS_LINE=0`: not; the menu changes it). | +| `LEONIDA_FRAME_GEN` | see the code | | | | `leonida-gpu/dlss.rs` +4 | `LEONIDA_FRAME_GEN=2\|3\|4` (frames shown per rendered one; unset or 1: off) with the SDK's signed DLLs in `LEONIDA_STREAMLINE_DIR` (sl.interposer, sl.common, sl.dlss_g, sl.reflex, sl.pcl, nvngx_dlssg). | +| `LEONIDA_FRAME_PEEK` | see the code | | | | `leonida-gpu/draw.rs` | With `peek` the shared word is read first and written only when the frame changed (`LEONIDA_FRAME_PEEK=0`: swapped at every ask, as before). | +| `LEONIDA_FRONTS_LEAN` | on, `0` turns it off | yes | | yes | `leonida-gpu/host.rs` | ... thread ([`fronts_let_go`]), not on the submitting thread (`LEONIDA_FRONTS_LEAN=0`: as before; `LEONIDA_AB` can turn it on and off while the title runs).... | +| `LEONIDA_FSR_FRAMEGEN` | see the code | | | | `leonida-gpu/fsr.rs` +4 | ... tree's presenter and to the inputs [`crate::fg`] keeps. - `LEONIDA_FSR_FRAMEGEN=1` at the start: the presenter's swap chain is FidelityFX's frame interpolation swap chain, and each present is told the depth and motion v... | +| `LEONIDA_FSR_FRAMEGEN_DEBUG` | see the code | | | | `leonida-gpu/fsr.rs` | Their signatures are checked before they are loaded. - `LEONIDA_FSR_FRAMEGEN_DEBUG=1`: FidelityFX draws its tear and pacing lines. | +| `LEONIDA_FULL_CARD_PASS` | see the code | | | | `leonida-gpu/draw.rs` | Whether a pass over the textures picked by index on a full card holds back the slots that need a new host copy (`LEONIDA_FULL_CARD_PASS=0`: no, as before: they stay due, each pass looks at the same ones again and stops a... | +| `LEONIDA_GPU_LOAD_MS` | see the code | | | | `leonida-gpu/queue.rs` | What the title's GPU time is made to look like, in ticks (`LEONIDA_GPU_LOAD_MS`; unset: as it is). | +| `LEONIDA_GPU_READ_ONLY_NO_BACK` | see the code | | | yes | `leonida-gpu/shadow.rs` +1 | Whether shader writes declared over GPU read-only title memory are left out of the copy-back (`LEONIDA_GPU_READ_ONLY_NO_BACK`, on unless `0`; `LEONIDA_AB` switches it by turns): the console cannot have a shader write the... | +| `LEONIDA_GPU_TIMING` | off unless set and not `0` | | | yes | `leonida-gpu/copystat.rs` +1 | With `LEONIDA_GPU_TIMING`: a GPU timestamp before each noted command and at the end, and where they are read back. | +| `LEONIDA_GPU_TIMING_KINDS` | see the code | | | | `leonida-gpu/copystat.rs` | (`LEONIDA_GPU_TIMING_KINDS=<n>`: so many of the heaviest are listed instead of forty.) | +| `LEONIDA_GPU_TIMING_SLOW_MS` | see the code | | | | `leonida-gpu/host.rs` | From how many milliseconds a list of the timing run is logged as slow, with what its time is made of (`LEONIDA_GPU_TIMING_SLOW_MS`, 50). | +| `LEONIDA_GROUP_PACK` | see the code | | | yes | `leonida-gpu/draw.rs` +6 | `LEONIDA_GROUP_PACK=<K>`: the most console groups of 32 threads a host group runs (2, 4 or 8; 0, 1 or unset: one to a group, as the console does). | +| `LEONIDA_GUARD_ASK` | see the code | | | | `leonida-gpu/watch.rs` | `LEONIDA_GUARD_ASK=1` asks every time, as before. | +| `LEONIDA_GUARD_HOLES` | see the code | | | | `leonida-gpu/watch.rs` | `LEONIDA_GUARD_HOLES=0` looks at the first address only, as before. | +| `LEONIDA_GUARD_HOT` | see the code | yes | | | `leonida-gpu/watch.rs` | `LEONIDA_GUARD_HOT=0`: 3 ms as before); - view memory is not asked of the kernel, which refuses it ([`VIEWS`]; ~300 refused askings a frame). | +| `LEONIDA_GUARD_REST` | on, `0` turns it off | yes | | | `leonida-gpu/watch.rs` | How long a block the title has just opened by a write is left open by those that take it (`LEONIDA_GUARD_REST=<microseconds>`, 3,000 unless given; `0`: not at all, as before). 220 of a frame's 586 faults came within 3 ms... | +| `LEONIDA_HEAP_ID_GUARD` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor.rs` +1 | Runs of dynamic slots a release refused since the last call (`LEONIDA_HEAP_ID_GUARD`), logged with the recording line. | +| `LEONIDA_HEAP_PASS_ASIDE` | see the code | | | | `leonida-gpu/host/aside.rs` | `LEONIDA_HEAP_PASS_ASIDE=0`: done where it is needed, as before. | +| `LEONIDA_HEAP_PRINT_SPREAD` | see the code | | | yes | `leonida-gpu/draw.rs` +1 | Leonida: how many more places of a texture's memory [`fingerprint`] reads, 256 bytes each, spread over its 64 KiB steps (`LEONIDA_HEAP_PRINT_SPREAD=<places>`, `1`: 64; unset or 0: none, as before). | +| `LEONIDA_HEAP_RECHECK` | see the code | | | | `leonida-gpu/draw.rs` | Whether textures picked by index are looked at again after their upload (`LEONIDA_HEAP_RECHECK=0`: no). | +| `LEONIDA_HEAP_RECHECK_EVERY` | see the code | | | | `leonida-gpu/draw.rs` +1 | Leonida: frames between further looks at an uploaded texture picked by index once [`RECHECK_FRAMES`] is through (`LEONIDA_HEAP_RECHECK_EVERY`, 300; 0: never again, as before). | +| `LEONIDA_HEAP_SPREAD` | see the code | | | | `leonida-gpu/draw.rs` | Whether the slots looked at again for no write are a part of them at every pass, each slot at every sixteenth (`LEONIDA_HEAP_SPREAD=0`: all of them at every sixteenth pass, as before). | +| `LEONIDA_HEAP_SYNC` | see the code | | | | `leonida-gpu/descriptor.rs` +1 | Whether [`sync_heaps`] is done (`LEONIDA_HEAP_SYNC=0`: not). | +| `LEONIDA_HEAP_SYNC_ASIDE` | see the code | | | | `leonida-gpu/descriptor.rs` | Whether a submission's [`sync_heaps`] is done by a thread of its own beside the rest of the preparing (`LEONIDA_HEAP_SYNC_ASIDE=0`: in front of it, as before). | +| `LEONIDA_HEAP_SYNC_EARLY` | see the code | | | | `leonida-gpu/descriptor.rs` | How long that thread waits for a submission before it makes a round of its own (`LEONIDA_HEAP_SYNC_EARLY=<ms>`, 4 if not given; `0`: none). | +| `LEONIDA_HEAP_TEXTURES` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_HEAP_TEXTURES=0` turns it off. | +| `LEONIDA_HELD_GREY` | off unless set and not `0` | yes | | | `leonida-gpu/descriptor/host.rs` +1 | `LEONIDA_HELD_GREY=1`; off by default (unset or `0`: null, as before). | +| `LEONIDA_HELD_LEVELS` | see the code | | | | `leonida-gpu/resource.rs` | Whether a texture the title places in memory is read, kept and uploaded from the first level its views show on (`LEONIDA_HELD_LEVELS=0`: whole, as before). | +| `LEONIDA_HELD_RESCHEDULE` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor/host.rs` | ...ken by [`TextureQueue::room`] before its own look was due (`LEONIDA_HELD_RESCHEDULE=0`: left in, as before).... | +| `LEONIDA_HELPER_OWN` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | Whether a pixel shader's helper lane reads its own value where the console reads the first lane's (`lower.rs` `first_lane`); on unless `LEONIDA_HELPER_OWN=0`. | +| `LEONIDA_HELPER_PRIORITY` | on, `0` turns it off | yes | | | `leonida-gpu/cores.rs` +5 | Whether the threads the submitting thread waits for run at its priority (`LEONIDA_HELPER_PRIORITY`, on unless `0`; `LEONIDA_AB` can flip it while the title runs): above normal, ahead of the title's threads and of the thr... | +| `LEONIDA_HURRY` | on, `0` turns it off | yes | | yes | `leonida-gpu/list/thin.rs` | Whether what the thread that prepares submissions stands at is translated first, and above normal priority while it is (`LEONIDA_HURRY`, on unless `0`: in turn, as before; `LEONIDA_AB` can flip it while the title runs). | +| `LEONIDA_INDIRECT_BATCH_2` | see the code | yes | | | `leonida-gpu/draw.rs` | (`LEONIDA_AB=<s>,LEONIDA_INDIRECT_BATCH_2`, `..._3` or `..._4`: that setting while the switch is on, so that one run measures it against the setting in one scene.) | +| `LEONIDA_INDIRECT_BATCH_3` | see the code | yes | | | `leonida-gpu/draw.rs` | | +| `LEONIDA_INDIRECT_BATCH_4` | see the code | yes | | | `leonida-gpu/draw.rs` | | +| `LEONIDA_INDIRECT_CARD_BUDGET` | see the code | | | | `leonida-gpu/host.rs` +1 | Whether a list's indirect-work budget lives in the card's own memory (`LEONIDA_INDIRECT_CARD_BUDGET=0` keeps it in memory the CPU maps, as before). | +| `LEONIDA_INDIRECT_REST` | see the code | | | yes | `leonida-gpu/indirect.rs` | Whether a record that does not fit in what is left of its list's budget takes the rest, so that every record after it runs empty too (`LEONIDA_INDIRECT_REST=1`; off by default so one oversized record takes nothing and la... | +| `LEONIDA_INDIRECT_RUNS` | off unless set and not `0` | | | yes | `leonida-gpu/draw.rs` | `LEONIDA_INDIRECT_RUNS=1` (diagnostics; off): [`INDIRECT_RUNS`] counted, which copies every indirect execution's root arguments. | +| `LEONIDA_INDIRECT_WIDE` | see the code | | | yes | `leonida-gpu/indirect.rs` | ...h, 2^20 ([`SOURCE`]'s GROUPS) what is bounded here anyway (`LEONIDA_INDIRECT_WIDE=0`: 65,535; a record that asks for more still runs 65,535).... | +| `LEONIDA_INDIRECT_WINDOW` | see the code | | | | `leonida-gpu/draw.rs` +3 | Whether indirect draws that read record after record of one argument buffer are clamped a window at a time (`LEONIDA_INDIRECT_WINDOW=1`; off by default). | +| `LEONIDA_INPLACE` | see the code | | | | `leonida-gpu/inplace.rs` | `LEONIDA_INPLACE`: 0 (unset) off. 1: a window of title memory outside buffers that lies in private memory committed whole is not copied: a part of the title's allocation is opened as a host heap and the window is a buffe... | +| `LEONIDA_INPLACE_MB` | see the code | | | | `leonida-gpu/inplace.rs` | The most title memory in place at once, in bytes (`LEONIDA_INPLACE_MB`, 4096): opening locks the pages into the PC's memory, also those the title never touched. | +| `LEONIDA_INPLACE_PROBE` | see the code | | | | `leonida-gpu/host.rs` +1 | This file holds the two openings Direct3D has, a probe that says what this PC's driver makes of them (`LEONIDA_INPLACE_PROBE`), and a census of which title memory could be opened. | +| `LEONIDA_INPLACE_PROBE_MB` | see the code | | | | `leonida-gpu/inplace.rs` | | +| `LEONIDA_JOIN_COPIES` | see the code | | yes | | `leonida-gpu/host.rs` +3 | Whether a title buffer copy that continues the one recorded before it in its list becomes one step with it (`LEONIDA_JOIN_COPIES=1`; off by default). | +| `LEONIDA_JOIN_LISTS` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_JOIN_LISTS`, 48). | +| `LEONIDA_JOIN_PARTS` | see the code | yes | | yes | `leonida-gpu/host.rs` +4 | How many parts of submissions, and lists, the line's thread gives to the host as one (`LEONIDA_JOIN_PARTS=<n>`; off by default, 1; `LEONIDA_JOIN_LISTS`, 48). | +| `LEONIDA_JOIN_PARTS_AB` | see the code | | | yes | `leonida-gpu/host.rs` | Named in `LEONIDA_AB`: the parts asked for (8 when not asked) against `LEONIDA_JOIN_PARTS_AB` (1 when not set). | +| `LEONIDA_KEEP_BY_LIST` | on, `0` turns it off | yes | | yes | `leonida-gpu/descriptor/host.rs` | `LEONIDA_KEEP_BY_LIST=0`: each slot keeps its own, as before; by turns under A/B (a slot keeps what it showed during a phase without it until it is made again without it). | +| `LEONIDA_KEEP_FREED` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_KEEP_FREED=0`: it is given back as before). | +| `LEONIDA_KEEP_SHOWN` | see the code | yes | | | `leonida-gpu/descriptor/host.rs` +1 | ...it shows until the new one is made and its upload has run (`LEONIDA_KEEP_SHOWN`): 0: never, it reads as zeros, then as the neutral texture; 1: one of the same kind in another place or size; 2: any of the same dimension.... | +| `LEONIDA_KEEP_SNAPSHOTS` | see the code | | | | `leonida-gpu/shadow.rs` | Whether a copy's snapshot is kept from one submission to the next and only the pieces that changed in between are taken again (`LEONIDA_KEEP_SNAPSHOTS=1`; off by default). | +| `LEONIDA_KEEP_SNAPSHOTS_MB` | see the code | | | | `leonida-gpu/shadow.rs` | `LEONIDA_KEEP_SNAPSHOTS_MB`, 256 unless set (it was 768: run 80, with kept snapshots beside copies in the card's memory, ran the PC out of memory in 27 s; kept snapshots are the PC's memory, all of it resident). | +| `LEONIDA_KEEP_VIEWS` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_KEEP_VIEWS=0` makes it null at once, as before. | +| `LEONIDA_KNOWN_HOLES` | see the code | | | | `leonida-gpu/watch.rs` | Whether placeholders are known for what they are (`LEONIDA_KNOWN_HOLES=0`: every hole is looked at at every asking, as before). | +| `LEONIDA_LAND` | see the code | | | | `leonida-gpu/land.rs` +1 | What shaders wrote goes into title memory on a few threads (`LEONIDA_LAND`, on by default; `=0` merges piece by piece on the thread that lands flights, as before). | +| `LEONIDA_LANDED_EXACT` | see the code | yes | | | `leonida-gpu/host.rs` | Whether a shader's write went into `[at, at + len)` lately: into a 4 KiB page of them in the last 600 frames, or with `LEONIDA_LANDED_EXACT=1` into those bytes, by cells of 8 (`crate::watch::landed_lately_exact`: this sp... | +| `LEONIDA_LAND_ANYTIME` | see the code | | | | `leonida-gpu/land.rs` | Whether a piece is put through a view of ours while the runtime changes a mapping too (`LEONIDA_LAND_ANYTIME=0`: through the title's address, as before). | +| `LEONIDA_LAND_BESIDE` | see the code | | | | `leonida-gpu/land.rs` | With `LEONIDA_LAND_BESIDE` (on by default) title memory that is a view of the title's physical pages is written through a view of our own of the same pages ([`crate::inplace::beside`]). | +| `LEONIDA_LAND_ECHO` | on, `0` turns it off | yes | | | `leonida-gpu/shadow.rs` +1 | Whether a refresh looks if what counts as written is only what a landing put there, and then sends nothing of it up (`LEONIDA_LAND_ECHO=0`: it copies and sends it, as before). | +| `LEONIDA_LAND_SAME` | on, `0` turns it off | yes | | | `leonida-gpu/land.rs` | `LEONIDA_LAND_SAME=0`: put and noted as before. | +| `LEONIDA_LAND_SKIP` | see the code | | | | `leonida-gpu/land.rs` | `LEONIDA_LAND_SKIP=1`, off by default: counted either way). | +| `LEONIDA_LAND_TAKEN` | see the code | | | | `leonida-gpu/land.rs` | Whether a copy a landing went through is noted as up to date with it (`LEONIDA_LAND_TAKEN=0`: it is not, and the next refresh copies the 64 KiB again and sends them up to the card, as before). | +| `LEONIDA_LAND_THREADS` | see the code | | | | `leonida-gpu/land.rs` | How many threads land, the relay's own counted (`LEONIDA_LAND_THREADS`). | +| `LEONIDA_LATE_WAIT` | see the code | | | yes | `leonida-gpu/host.rs` +2 | ...ission is waited for, so CPU and GPU never overlap (unless `LEONIDA_LATE_WAIT=1`, see [`late`]); overlap them with per-submission fences once more than clears run.... | +| `LEONIDA_LATE_WAITS` | see the code | | | | `leonida-gpu/frame.rs` | `LEONIDA_LATE_WAITS=1` sleeps to the next tick, as before. | +| `LEONIDA_LATE_WAIT_LISTS` | see the code | | | | `leonida-gpu/host.rs` | The most host lists in the air before the flights are settled (`LEONIDA_LATE_WAIT_LISTS`, 256; `=128` is the value before: with the relay it stopped the submitting thread twice a frame for 92-103 ms in all while the card... | +| `LEONIDA_LATE_WAIT_WRITES` | see the code | | | | `leonida-gpu/host.rs` | Whether a submission with bottom-of-pipe writes may fly (`LEONIDA_LATE_WAIT_WRITES=0`: it is settled as soon as it is sent, so the title is told at once, as before; for telling a title that polls such a value from one th... | +| `LEONIDA_LAZY_PRELUDE` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_LAZY_PRELUDE=0`: made with the list, as before. | +| `LEONIDA_LAZY_TEXTURES` | see the code | | | | `leonida-gpu/resource.rs` | `LEONIDA_LAZY_TEXTURES=0` makes each when the title creates its texture, as before. | +| `LEONIDA_LDS_BOUNDS` | see the code | | | yes | `leonida-gpu/shader_cache.rs` +2 | `LEONIDA_LDS_BOUNDS=0`: every address taken as in bounds, as before (a compare and a select fewer per access). | +| `LEONIDA_LDS_BOUNDS_EXEMPT` | see the code | | | yes | `leonida-gpu/shader_cache.rs` +1 | And `LEONIDA_LDS_BOUNDS_EXEMPT=<hash>,<hash>`: the programs whose LDS accesses are taken as in bounds (`FormsFor::lds_unbounded`); unset, the face programs ([`FACE_PROGRAMS`]); `0` or empty, none. | +| `LEONIDA_LDS_FLAGS` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | `LEONIDA_LDS_FLAGS=0` turns this off. | +| `LEONIDA_LENT_HEAP` | see the code | | | | `leonida-gpu/descriptor.rs` | `LEONIDA_LENT_HEAP=0`: none, such a dispatch is dropped, as before. | +| `LEONIDA_LEVELS_MIN_KB` | see the code | | | | `leonida-gpu/tiles.rs` | The bytes from which a texture is made this way: a megabyte, or `LEONIDA_LEVELS_MIN_KB`. | +| `LEONIDA_LEVELS_ON_DEMAND` | see the code | | | | `leonida-gpu/tiles.rs` | Off unless `LEONIDA_LEVELS_ON_DEMAND=1`. | +| `LEONIDA_LIBRARY_HANDLE` | see the code | | | | `leonida-gpu/pipeline/library.rs` | `LEONIDA_LIBRARY_HANDLE=0`: closed, as before. | +| `LEONIDA_LIBRARY_LOCK` | see the code | | | | `leonida-gpu/pipeline/library.rs` | `LEONIDA_LIBRARY_LOCK=1`: one call at a time, as before. | +| `LEONIDA_LIBRARY_MAP` | see the code | | | | `leonida-gpu/pipeline/library.rs` | `LEONIDA_LIBRARY_MAP=0`: read and written through buffers, as before. | +| `LEONIDA_LIBRARY_PLAY_SAVE_MB` | see the code | | | | `leonida-gpu/pipeline/library.rs` | The largest library ([`save`]) written while the title runs, in bytes (`LEONIDA_LIBRARY_PLAY_SAVE_MB`, 256 when unset; a large value writes it whatever its size, as before). | +| `LEONIDA_LIBRARY_STATIC_SAMPLERS` | see the code | | | yes | `leonida-gpu/pipeline/library.rs` +2 | `LEONIDA_LIBRARY_STATIC_SAMPLERS=1`: under their plain names on NVIDIA too, for comparison. | +| `LEONIDA_LIBRARY_TRIM` | see the code | | | | `leonida-gpu/pipeline/library.rs` | `LEONIDA_LIBRARY_TRIM=0`: the pages stay until Windows takes them. | +| `LEONIDA_LIGHT_REFRESH` | see the code | | | | `leonida-gpu/host.rs` +1 | Whether the refreshes of host copies go the light way (`LEONIDA_LIGHT_REFRESH=0`: as before): view memory nothing wrote since it was last asked about is known by its bits ([`PUBLISHED`]), a copy nothing of whose range ch... | +| `LEONIDA_LIST_ALIAS_EXACT` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor/host.rs` +1 | `LEONIDA_LIST_ALIAS_EXACT=0`: as before. | +| `LEONIDA_LIST_FRONTS` | see the code | yes | | yes | `leonida-gpu/host.rs` | Whether a list's steps are gone through for what they refresh once, when the list is closed, by the thread that closes it (`LEONIDA_LIST_FRONTS=0`: by the thread that prepares the submission, for every submission, as bef... | +| `LEONIDA_LIST_POOL` | see the code | | | | `leonida-gpu/list.rs` | `LEONIDA_LIST_POOL=0`: each is made new and thrown away, as before). | +| `LEONIDA_LIST_SLOTS` | see the code | | | | `leonida-gpu/draw.rs` | For the frame listing, after a draw whose shader `LEONIDA_LIST_SLOTS` names: the heap slots it will pick textures from by index, and what the title and the host hold there (one `~slot` line each), with the words they wer... | +| `LEONIDA_LIST_VIEWS` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor/host.rs` | Whether a list makes a view its tables hold once (`LEONIDA_LIST_VIEWS=0`: for every table). | +| `LEONIDA_MAPPED_BY_PAGE` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_MAPPED_BY_PAGE=1`: by page. | +| `LEONIDA_MAPPED_BY_VIEWS` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_MAPPED_BY_VIEWS=0`: the host is asked, as before. | +| `LEONIDA_MAP_THREADS` | off unless set and not `0` | | | | `leonida-gpu/host/menu.rs` +3 | With `LEONIDA_MAP_THREADS=1` (the NVIDIA launcher's) the GPU's page mappings came here range by range, a page after the other at 0.2-4 ms each in the world: single holds of 23-69 ms from this function, and 110 ms a frame... | +| `LEONIDA_MEMORY_CARD_MB` | see the code | | | | `leonida-gpu/shadow.rs` | At most so much on the card's own memory (4 GiB unless `LEONIDA_MEMORY_CARD_MB` says otherwise), and while it has room; past that the side shaders see is in the PC's memory. | +| `LEONIDA_MEMORY_DUMP` | see the code | | | | `leonida-gpu/memory.rs` | `LEONIDA_MEMORY_DUMP=<folder>`: when a file `go` appears there, the arenas as the card holds them are copied out and written (`arena-<n>.bin`), with `pages.txt` (title page, arena, offset) and the structures the walking... | +| `LEONIDA_MEMORY_MAP` | see the code | | yes | yes | `leonida-gpu/copystat.rs` +1 | `LEONIDA_MEMORY_MAP=0` leaves the walk out. | +| `LEONIDA_MENU` | see the code | | | | `leonida-gpu/host/trainer.rs` +3 | Whether the menu is on: unless `LEONIDA_MENU=0`. | +| `LEONIDA_MENU_ARGS` | see the code | | | | `leonida-gpu/host/menu.rs` +1 | ... RESTART" starts play.ps1 again (`LEONIDA_MENU_PLAY`, with `LEONIDA_MENU_ARGS`) and ends this run.... | +| `LEONIDA_MENU_CONSOLE` | see the code | | | | `leonida-gpu/host/menu.rs` +1 | | +| `LEONIDA_MENU_FILE` | see the code | | | | `leonida-gpu/host/menu.rs` +1 | Most settings are read once at start, so a change is saved to the file `LEONIDA_MENU_FILE` names (play.ps1 sets it to the play folder's settings.txt and applies it at every start) and takes effect at the next start; "SAV... | +| `LEONIDA_MENU_PLAY` | see the code | | | | `leonida-gpu/host/menu.rs` +1 | ... the next start; "SAVE AND RESTART" starts play.ps1 again (`LEONIDA_MENU_PLAY`, with `LEONIDA_MENU_ARGS`) and ends this run.... | +| `LEONIDA_MENU_SMOOTH_MOTION` | see the code | | | | `leonida-gpu/host/menu.rs` +1 | | +| `LEONIDA_MESH_OUTPUT_STRICT` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | Experiment (`LEONIDA_MESH_OUTPUT_STRICT=1`): they are refused. | +| `LEONIDA_MESH_TEST` | see the code | | | | `leonida-gpu/draw.rs` | An experiment on mesh draws (`LEONIDA_MESH_TEST`): 1 for `skip` (none is issued), 2 for `scissor` (each runs its shaders but rasterises one pixel), 0 otherwise. | +| `LEONIDA_MIN_LOD_KEPT` | on, `0` turns it off | yes | | | `leonida-gpu/tiles.rs` | `LEONIDA_MIN_LOD_KEPT=0`: reduced by as many levels as the view's start moved, as before (`LEONIDA_AB` can flip it for the views made from then on). | +| `LEONIDA_NAN_SCRUB` | see the code | | | | `leonida-gpu/host/menu.rs` +4 | `LEONIDA_NAN_SCRUB=1` (off by default): see `Lower::scrub_nan`. | +| `LEONIDA_NULL_SAMPLER_LINEAR` | see the code | | | | `leonida-gpu/descriptor/host.rs` +1 | LOCAL (11/26, `LEONIDA_NULL_SAMPLER_LINEAR=1`): a linear one instead. | +| `LEONIDA_OPEN_ONE_VIEW` | on, `0` turns it off | yes | | | `leonida-gpu/watch.rs` | Whether a write fault opens the view that was written and leaves the page's other views read-only, not clean any more (`LEONIDA_OPEN_ONE_VIEW=0`: opens them all, as before). | +| `LEONIDA_OUTPUT` | see the code | | | | `leonida-gpu/aspect.rs` +2 | Neither makes the title draw a wider view: that is the title's output size (`LEONIDA_OUTPUT`, leonida-loader's `hooks.rs`, and `docs/ultrawide.md` for what is known of it). | +| `LEONIDA_PAGE_ASK` | on, `0` turns it off | yes | | yes | `leonida-gpu/watch.rs` | Whether a fault asks Windows about its one page before it asks about the region around it (`LEONIDA_PAGE_ASK=0`: the region only, as before). | +| `LEONIDA_PAGE_PARTS` | see the code | | | | `leonida-gpu/watch.rs` | Whether the parts of a page that the kernel names are kept, and a refresh copies those (`LEONIDA_PAGE_PARTS=0`: the 64 KiB page, as before). | +| `LEONIDA_PAGE_WRITES` | see the code | | | | `leonida-gpu/descriptor/host.rs` +2 | What `LEONIDA_PAGE_WRITES` asks to be done with a write the guards do not see once its bytes are there ([`title_memory_written`]), as bits: 1, the guarded blocks under it are opened and count as written (host copies of b... | +| `LEONIDA_PAINTED_EVERY` | see the code | | | yes | `leonida-gpu/draw.rs` | How many frames apart a texture picked by index is looked at once a look found it changed with nothing to tell of it (`LEONIDA_PAINTED_EVERY=<frames>`, 8 unless said, at most 120; 0: as before, by [`RECHECK_FRAMES`] and... | +| `LEONIDA_PAIRED_FOR` | see the code | | yes | yes | `leonida-gpu/shader_cache.rs` +3 | The programs a `LEONIDA_PAIRED_FOR` or `LEONIDA_WAVE_WIDE_FOR` list names: hashes as the log and the frame listings name shaders (the first 16 hex digits of the container's BLAKE3), or their beginnings from 8 digits on,... | +| `LEONIDA_PAIRED_LANES` | see the code | | | yes | `leonida-gpu/shader_cache.rs` +2 | `LEONIDA_PAIRED_LANES`: - unset or `1`: right before the wave-wide form, for any console wave64 compute program every earlier form refused (the 2-D tile groups of one console wave as well as 1-D groups with divergent cro... | +| `LEONIDA_PAIRED_SHADER_DIR` | see the code | | | | `leonida-gpu/shader_cache.rs` | | +| `LEONIDA_PANEL` | off unless set and not `0` | | | yes | `leonida-gpu/host/menu.rs` +3 | Diagnostics: the run's numbers on the picture (`LEONIDA_PANEL=1`; off by default; F3 shows and hides it while our window has the focus): white text on a black box in the upper left corner of what is shown, so that a scre... | +| `LEONIDA_PARTIAL_WRITTEN` | on, `0` turns it off | yes | | yes | `leonida-gpu/texture.rs` | `LEONIDA_PARTIAL_WRITTEN=0`: every 30th frame only, as before; `LEONIDA_AB` can turn it while the title runs). | +| `LEONIDA_PASSES_AHEAD` | see the code | yes | | | `leonida-gpu/draw.rs` +1 | ...f ours that is sent ahead of the frame's first submission (`LEONIDA_PASSES_AHEAD`: 1 or 0, or 2 for [`passes_ahead_where_sent`]; unset: with `LEONIDA_THIN=1`).... | +| `LEONIDA_PENDING_FAST` | on, `0` turns it off | yes | | | `leonida-gpu/shadow.rs` | Whether a copy that no submission's shaders may be writing says so without the lock of its declared ranges (`LEONIDA_PENDING_FAST=0`: the lock is taken to find the list empty, as before). | +| `LEONIDA_PICKED_MB` | see the code | | | | `leonida-gpu/picked.rs` | Bytes looked at in turn per frame (`LEONIDA_PICKED_MB`). | +| `LEONIDA_PICKED_WRITES` | see the code | yes | | yes | `leonida-gpu/picked.rs` | Buffers shaders write through views they pick from the heap by an index they compute (`LEONIDA_PICKED_WRITES`; on, stage 1, by default: [`stage`]). | +| `LEONIDA_PIPELINE_LOWEST` | see the code | | | | `leonida-gpu/pipeline/make.rs` | Below the title's own threads (loading, recording), and the streaming one, which is below normal itself (`LEONIDA_PIPELINE_LOWEST=0`: level with it, as before). | +| `LEONIDA_PIPELINE_PANIC_CATCH` | see the code | | | | `leonida-gpu/pipeline/make.rs` | `LEONIDA_PIPELINE_PANIC_CATCH=0`: the panic goes on, as before. | +| `LEONIDA_PIPELINE_SLOW` | see the code | | | | `leonida-gpu/pipeline/make.rs` | `LEONIDA_PIPELINE_SLOW=0`: in the order the title creates them, as before. | +| `LEONIDA_PIPELINE_WAIT_MS` | see the code | | yes | yes | `leonida-gpu/host/menu.rs` +2 | ...e budget in every frame in which a draw asked for it: with `LEONIDA_PIPELINE_WAIT_MS=10000` the picture stood still while the thing drawn with it was in view, and moved again when the camera turned away.... | +| `LEONIDA_PIPELINE_WAIT_ONCE` | see the code | | | | `leonida-gpu/pipeline/make.rs` | `LEONIDA_PIPELINE_WAIT_ONCE=0` waits as before. | +| `LEONIDA_PIPELINE_WAIT_SHARED` | see the code | | | | `leonida-gpu/pipeline/make.rs` | `LEONIDA_PIPELINE_WAIT_SHARED=0` counts as before. | +| `LEONIDA_PIPELINE_WORKERS` | see the code | | | | `leonida-gpu/pipeline/make.rs` | `asked` (`LEONIDA_PIPELINE_WORKERS`, 1 to 64), else two thirds of the logical processors, 2 to 16. | +| `LEONIDA_PLACED_FILLER` | see the code | | | | `leonida-gpu/resource.rs` | `LEONIDA_PLACED_FILLER=1`: kept in the key, as before. | +| `LEONIDA_PLACED_LEFT_READERS` | see the code | yes | | | `leonida-gpu/host/card_steps.rs` | ...ne of its lists waits for them and the CPU still needs it (`LEONIDA_PLACED_LEFT_READERS=1`; off by default; `LEONIDA_AB` can name it). [`Host::card_steps`] is asked when something keeps a submission from being prepared.... | +| `LEONIDA_PLACED_NORMAL` | see the code | | | | `leonida-gpu/descriptor.rs` | `LEONIDA_PLACED_NORMAL=0` keeps them as the title gave them, as before. | +| `LEONIDA_PLACED_ORDER` | off unless set and not `0` | yes | | | `leonida-gpu/host/card_steps.rs` | ...rd in front of the lists if that stands behind it in them (`LEONIDA_PLACED_ORDER=1`; off: wherever it stands), and a submission where it does is cut behind the copy's list ([`cut_for`]).... | +| `LEONIDA_PLACED_READERS` | on, `0` turns it off | yes | | | `leonida-gpu/host/place.rs` | Whether only the steps behind a copy at its place in a list count as its readers (on unless `LEONIDA_PLACED_READERS=0`: every step of the submission that reads its destination, wherever it stands, as before; `LEONIDA_AB`... | +| `LEONIDA_PLACED_TITLE` | see the code | yes | yes | | `leonida-gpu/host.rs` +1 | ...ad its destination on the CPU do not wait for the flights (`LEONIDA_PLACED_TITLE=1`; off by default).... | +| `LEONIDA_PLACED_UNDECLARED` | on, `0` turns it off | yes | | yes | `leonida-gpu/host.rs` | `LEONIDA_PLACED_UNDECLARED=0`: asked of every destination, as before. | +| `LEONIDA_PLACE_TAKEN` | see the code | | | | `leonida-gpu/memory.rs` | `LEONIDA_PLACE_TAKEN=0`: it counts as never taken, as before). | +| `LEONIDA_POP_ALL` | see the code | | | | `leonida-gpu/popwatch.rs` | `LEONIDA_POP_FOLDER=<folder>`: the three pictures around a frame with blips (at most 200 times) are saved there, 640 wide; with `LEONIDA_POP_ALL=1` every frame's is. | +| `LEONIDA_POP_FOLDER` | see the code | | | | `leonida-gpu/popwatch.rs` | `LEONIDA_POP_FOLDER=<folder>`: the three pictures around a frame with blips (at most 200 times) are saved there, 640 wide; with `LEONIDA_POP_ALL=1` every frame's is. | +| `LEONIDA_POP_WATCH` | see the code | | | | `leonida-gpu/popwatch.rs` | `LEONIDA_POP_WATCH=<from>-<to>[,<from>-<to>..]` (seconds since the start): every presented frame in those times is read back, made small on a thread of its own and compared with its neighbours, block by block. | +| `LEONIDA_PORT_CBV` | see the code | | | | `leonida-gpu/port_cbv.rs` +3 | Renderer port 5 (`LEONIDA_PORT_CBV=1`; off by default): constant buffers are read as raw bytes, a table's through the raw twin of its slot ([`raw_views`]), a root one as a root SRV, so the host can give the card the titl... | +| `LEONIDA_PORT_CBV_PLACE` | on, `0` turns it off | yes | | | `leonida-gpu/port_cbv.rs` | `LEONIDA_PORT_CBV_PLACE=0`: copied as before, and read through the raw twin all the same). | +| `LEONIDA_PORT_CONSTANTS` | see the code | | | yes | `leonida-gpu/draw.rs` +4 | Renderer port #1: the title's 32-bit graphics heap as the card's own memory (`LEONIDA_PORT_CONSTANTS`, off by default). | +| `LEONIDA_PORT_CONSTANTS_ORDER` | on, `0` turns it off | yes | | | `leonida-gpu/draw.rs` | ...RT_CONSTANTS=1`) are clamped alone, right before they run (`LEONIDA_PORT_CONSTANTS_ORDER`; `=0`: in batches and windows as any other; it matters only with port 1 on).... | +| `LEONIDA_PORT_DESCRIPTORS_CHECK` | see the code | | | | `leonida-gpu/port_descriptors.rs` | Pages the fallback looks at a frame (`LEONIDA_PORT_DESCRIPTORS_CHECK=<pages>`, 16 if not given; 0: none, and the write watch is not asked at all). | +| `LEONIDA_PORT_DESCRIPTORS_EVERY` | see the code | | | | `leonida-gpu/port_descriptors.rs` | Frames between askings of the write watch for the fallback (`LEONIDA_PORT_DESCRIPTORS_EVERY=<frames>`, 8 if not given). | +| `LEONIDA_PORT_GUARD` | see the code | yes | yes | yes | `leonida-gpu/watch.rs` +1 | Renderer port #6 (`LEONIDA_PORT_GUARD=1`, off by default; read here, and A/B-able in one run with `LEONIDA_AB=<s>,LEONIDA_PORT_GUARD`): the guards' one lock no longer makes the title's write faults, and the refreshes' lo... | +| `LEONIDA_PORT_GUARD_PLAN` | see the code | yes | | | `leonida-gpu/watch.rs` | ...itting one, as it already was for more than 256 refreshes (`LEONIDA_PORT_GUARD_PLAN=0`: on the submitting thread, as before; A/B-able by that name).... | +| `LEONIDA_PORT_JOURNAL` | see the code | yes | | yes | `leonida-gpu/port_journal.rs` +1 | Renderer port #7: the submitting lane's last waits (`LEONIDA_PORT_JOURNAL=1`, off by default; the switch is [`crate::watch::port_journal`]). | +| `LEONIDA_PRELUDE_UPLOAD` | see the code | yes | | | `leonida-gpu/texture.rs` | ...sion once the check of the texture's memory is done there (`LEONIDA_PRELUDE_UPLOAD=0`: by the list itself, where it was recorded, as before).... | +| `LEONIDA_PRESENT_10BIT` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_PRESENT_10BIT=0`: 8 bits, as before. | +| `LEONIDA_PRESENT_SCALE` | see the code | | | | `leonida-gpu/aspect.rs` +3 | Read by leonida-hle's `lifecycle.rs`, which widens the window the title asks for. - `LEONIDA_PRESENT_SCALE=fit\|stretch`: `fit` keeps the picture's shape in a window of another one, centred, with black bars beside it (or... | +| `LEONIDA_PRESENT_SMOOTH` | see the code | yes | | yes | `leonida-gpu/host.rs` +1 | `LEONIDA_PRESENT_SMOOTH=<fraction>`: each host present is held until at least that fraction of the recent mean interval between presents has passed since the one before, so a quick frame after a slow one waits a little i... | +| `LEONIDA_PROFILE` | see the code | | | yes | `leonida-gpu/copystat.rs` +1 | `LEONIDA_PROFILE=<from>,<to>,<ms>,<file>` samples the stacks of the busiest threads every `<ms>` milliseconds between two times (seconds, as `LEONIDA_STACKS`), and writes them counted to `<file>` at the end (several of t... | +| `LEONIDA_QUEUE_MARKS` | off unless set and not `0` | yes | | yes | `leonida-gpu/descriptor/host.rs` | Off by default (`LEONIDA_QUEUE_MARKS=1`; `LEONIDA_AB` can name it): here no one waited for that lock, and by turns the submitting thread worked +0.27 and +0.06 ms a frame with the marks (runs d41). | +| `LEONIDA_QUEUE_WAIT` | see the code | | | | `leonida-gpu/queue.rs` | `LEONIDA_QUEUE_WAIT=0`: they do not, and every submission runs when it is made (as before). | +| `LEONIDA_QUICK_FIND` | on, `0` turns it off | yes | | | `leonida-gpu/shadow.rs` | Whether [`FOUND`] is kept (`LEONIDA_QUICK_FIND=0`: not). | +| `LEONIDA_QUICK_FIND_WINDOWS` | see the code | yes | yes | yes | `leonida-gpu/shadow.rs` +1 | Whether a thread also remembers what its asks for memory outside buffers found (`LEONIDA_QUICK_FIND_WINDOWS=1`; off by default, and only on the 4 MiB grid without tails: with finer windows the answer depends on the other... | +| `LEONIDA_QUICK_MIRROR` | see the code | | | | `leonida-gpu/descriptor/host.rs` | Whether a slot already made from its record is told so without the lock (`LEONIDA_QUICK_MIRROR=0`: with it, as before). | +| `LEONIDA_RAW_VIEWS` | see the code | | | | `leonida-gpu/descriptor/host.rs` +1 | `LEONIDA_RAW_VIEWS=0`: they read the title's slots themselves, as before). | +| `LEONIDA_RAW_VIEW_CLAMP` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_RAW_VIEW_CLAMP=0` makes it from the range asked for, as before (what would have been cut is still counted). | +| `LEONIDA_READY_ONCE` | on, `0` turns it off | yes | | | `leonida-gpu/draw.rs` | Whether a table a list reads again, with nothing changed in the list since, is left as it is (`LEONIDA_READY_ONCE=0`: every entry is gone through again at every draw). | +| `LEONIDA_READ_BACK` | see the code | | | | `leonida-gpu/list.rs` | `LEONIDA_READ_BACK=0` leaves them unmade, as before. | +| `LEONIDA_READ_BACK_POOL` | on, `0` turns it off | yes | | | `leonida-gpu/host.rs` | Whether a list's read-back buffers are kept, when the list is reset, for the next read backs of their sizes (`LEONIDA_READ_BACK_POOL=0`: each is made for its read back and let go with its list, as before; `LEONIDA_AB` ca... | +| `LEONIDA_READ_WATCH` | see the code | | | | `leonida-gpu/texback.rs` | ...ats float on; it read memory nothing had written (run rw1, `LEONIDA_READ_WATCH=1`: about 30 places in the title read those two kinds), and boats sank.... | +| `LEONIDA_READ_ZERO_GAPS` | see the code | | | | `leonida-gpu/host.rs` | ...ite over all of a texture's bytes less at each read of it (`LEONIDA_READ_ZERO_GAPS=0`: the whole buffer first, as before).... | +| `LEONIDA_REAPER` | see the code | yes | | | `leonida-gpu/host.rs` | Whether what the host is done with is let go of on a thread of its own ([`reaper`]; on by default, `LEONIDA_REAPER=0` turns it off; `LEONIDA_AB` can turn it on and off while the title runs). | +| `LEONIDA_RECHECK_SOON` | see the code | | | | `leonida-gpu/draw.rs` | Whether a texture found changed with nothing to tell of it is looked at again in the next frame (`LEONIDA_RECHECK_SOON=0`: after four, as before). | +| `LEONIDA_RECORD_ALWAYS` | see the code | | | | `leonida-gpu/replay/record.rs` | From `LEONIDA_RECORD`, `LEONIDA_RECORD_AT` (seconds, or `f<frame>`), `LEONIDA_RECORD_FRAMES` and `LEONIDA_RECORD_ALWAYS=1`. | +| `LEONIDA_RECORD_AT` | see the code | | | | `leonida-gpu/replay/record.rs` | From `LEONIDA_RECORD`, `LEONIDA_RECORD_AT` (seconds, or `f<frame>`), `LEONIDA_RECORD_FRAMES` and `LEONIDA_RECORD_ALWAYS=1`. | +| `LEONIDA_RECORD_FRAMES` | see the code | | | | `leonida-gpu/replay/record.rs` | From `LEONIDA_RECORD`, `LEONIDA_RECORD_AT` (seconds, or `f<frame>`), `LEONIDA_RECORD_FRAMES` and `LEONIDA_RECORD_ALWAYS=1`. | +| `LEONIDA_RECORD_THREADS_WIDE` | see the code | | | yes | `leonida-gpu/land.rs` | Threads of the pool for the heaps' records ([`each_view`]): as before, and with `LEONIDA_RECORD_THREADS_WIDE=1`. | +| `LEONIDA_REFLECT_MOST` | see the code | yes | yes | | `leonida-gpu/ambient.rs` +2 | Leonida: the brightest a reflection may be, as a multiple of the light around (`LEONIDA_REFLECT_MOST=<multiple>`; unset or 0: reflections as the title left them). | +| `LEONIDA_REFRESH_AHEAD` | see the code | | | | `leonida-gpu/host.rs` | Whether the copies that a submission's shaders write are brought up to date together, on several threads, ahead of its steps (`LEONIDA_REFRESH_AHEAD=0`: each before the step that gives it to them). 580 copies a frame, on... | +| `LEONIDA_REFRESH_CHECK` | see the code | | | | `leonida-gpu/host.rs` +1 | Diagnostic (`LEONIDA_REFRESH_CHECK=1`; off by default): after a refresh of `[from, to)` that trusted the write watch or the guards, the first 256 bytes of every 64 KiB block of it are read from title memory and compared... | +| `LEONIDA_REFRESH_DIRTY` | on, `0` turns it off | yes | | | `leonida-gpu/shadow.rs` | ...ss, and the lists of a card side read without their locks (`LEONIDA_REFRESH_DIRTY=0`: every page of the range looked at one by one, as before).... | +| `LEONIDA_REFRESH_FRONT` | off unless set and not `0` | | | | `leonida-gpu/host.rs` | Whether everything a submission refreshes is brought up to date in one go, on several threads, ahead of its steps (`LEONIDA_REFRESH_FRONT=1`, and with `LEONIDA_JOIN_PARTS`, which needs it; else in groups where the steps... | +| `LEONIDA_RELAY_COPY` | see the code | | | | `leonida-gpu/host.rs` +5 | Whether the pieces the relay fetches from the card's memory come over the card's copy queue (`LEONIDA_RELAY_COPY=1`) and not over the queue that draws. | +| `LEONIDA_RELAY_CROSS` | see the code | | | | `leonida-gpu/host/upcheck.rs` | LOCAL (11/26, `LEONIDA_RELAY_CROSS=1`): whether a refresh of `runs` reads title memory that a flight in the air may be writing through another copy of it ([`reads`] counts those). | +| `LEONIDA_RELOOK_MS` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_RELOOK_MS` (20,000 unless said; 4,000 before): at 4,000 the opening cutscene's 4 frames a second looked at its ~20,000 slots waiting for their memory every 16 frames, thousands of queries a second and most of th... | +| `LEONIDA_REMAP_BOOST` | on, `0` turns it off | yes | | | `leonida-gpu/watch.rs` | Whether the thread that changes a mapping runs at the highest priority while it holds title memory still (`LEONIDA_REMAP_BOOST=0`: at its own). | +| `LEONIDA_REMAP_HISTORY` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor/host.rs` | The cursor of the single shared pass with `LEONIDA_REMAP_HISTORY=0` (as before: the heap whose pass runs first takes the ranges). | +| `LEONIDA_REMAP_SPANS` | on, `0` turns it off | yes | | yes | `leonida-gpu/texture.rs` +1 | Whether a read in place that names its range ([`title_memory_reading_range`]) waits only for the changes of mapping that touch that range (`LEONIDA_REMAP_SPANS=0`: for every change, as before; `LEONIDA_AB` can name it).... | +| `LEONIDA_REPLAY_GBV` | see the code | | | | `leonida-gpu/replay/play.rs` | | +| `LEONIDA_REPLAY_PEEK` | see the code | | | | `leonida-gpu/replay/play/diverge.rs` | | +| `LEONIDA_RETIRE_QUEUES` | on, `0` turns it off | yes | | yes | `leonida-gpu/host.rs` | `LEONIDA_RETIRE_QUEUES=0`: every thread takes the first, as before. | +| `LEONIDA_REUPLOAD_WHEN_FULL` | see the code | | | | `leonida-gpu/draw.rs` | Whether a texture that has its host copy is still brought up to date while the card has no room for new ones (`LEONIDA_REUPLOAD_WHEN_FULL=0`: no). | +| `LEONIDA_RIPE_BLOCKS` | see the code | | | | `leonida-gpu/pool.rs` | How many blocks of textures are made ahead, so that one has been there for a while when its first piece is taken (`LEONIDA_RIPE_BLOCKS`, 12; 0: none, and new blocks are used at once, as before). | +| `LEONIDA_ROOT_DEDUPE` | on, `0` turns it off | yes | | | `leonida-gpu/pipeline/host.rs` | `LEONIDA_ROOT_DEDUPE=0`: one object per pipeline, as before. | +| `LEONIDA_ROOT_SRV_DIRECT` | see the code | | | | `leonida-gpu/draw.rs` +1 | `LEONIDA_ROOT_SRV_DIRECT=1` goes back to root descriptors. | +| `LEONIDA_ROOT_UAV_MB` | see the code | | | | `leonida-gpu/draw.rs` | False if the draw must be dropped. shortcut: a root view has no size: the view, the refresh and the copy back cover all that is left of the title's buffer (`LEONIDA_ROOT_UAV_MB` sets a limit for all three). | +| `LEONIDA_ROOT_VIEW_MB` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_ROOT_VIEW_MB` sets a limit again.) | +| `LEONIDA_RT_RESOLVE` | see the code | | | | `leonida-gpu/pipeline/make.rs` +1 | Without BVH, ~1,000 CS_RaytracingResolve shaders shade no hits while clogging the cold compiler queue; skip unless LEONIDA_RT_RESOLVE=1. | +| `LEONIDA_SAFE_COPY` | see the code | | | | `leonida-gpu/host.rs` +1 | `LEONIDA_SAFE_COPY=0`: through the kernel, as before. | +| `LEONIDA_SAME_RECORDS` | on, `0` turns it off | yes | | | `leonida-gpu/titlewrite.rs` | ...py of its own, but what is there already is never written (`LEONIDA_SAME_RECORDS=0`: always). # Safety `[from, from + n)` and `[to, to + n)` are the title's.... | +| `LEONIDA_SAMPLERS_AGAIN` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor.rs` | `LEONIDA_SAMPLERS_AGAIN=0`: not). | +| `LEONIDA_SAMPLE_MASK` | see the code | | | | `leonida-gpu/list.rs` +1 | `LEONIDA_SAMPLE_MASK=0`: ignored, as before. | +| `LEONIDA_SCISSOR_TEST` | see the code | | | | `leonida-gpu/draw.rs` | An experiment on the title's scissor rectangles (`LEONIDA_SCISSOR_TEST=full`): they are all widened to the whole target. | +| `LEONIDA_SCRATCH_CARD` | see the code | | | yes | `leonida-gpu/host.rs` | ... card's memory, at most [`SPARE_CARD_MOST`] of them idle), `LEONIDA_SCRATCH_CARD=1` or `0` either way, `LEONIDA_AB` by turns.... | +| `LEONIDA_SCRATCH_POOL` | see the code | | | | `leonida-gpu/host.rs` +1 | `LEONIDA_SCRATCH_POOL=0`: chunks of 4 MiB kept by their list, as before. | +| `LEONIDA_SCREEN_WAIT_MS` | see the code | | | | `leonida-gpu/pipeline/make.rs` | As [`wait_budget`], for passes over the screen (`LEONIDA_SCREEN_WAIT_MS`, 10 s; 0: like the others). | +| `LEONIDA_SECTION_MB` | see the code | | yes | yes | `leonida-gpu/inplace.rs` +2 | `LEONIDA_SECTION_MB=<MiB>` makes an allocation of sections of that many MiB at most (unset, 0 or not a number: all its pages in one section, as before). | +| `LEONIDA_SEND_BAR` | see the code | | | | `leonida-gpu/host/send.rs` | Whether the memory lies in the card's memory, written by the CPU through the bus (`LEONIDA_SEND_BAR=1`): the copies on the card's drawing queue, which nothing overlaps, then cross no bus. | +| `LEONIDA_SEND_CHANGED` | see the code | | | | `leonida-gpu/host.rs` +1 | Whether a refresh of a copy in the card's memory takes, and sends up, the dwords that title memory changed and no others (`LEONIDA_SEND_CHANGED=1`; off: the 64 KiB pages written since it last took them, whole). | +| `LEONIDA_SEND_OWN` | see the code | | | | `leonida-gpu/host/send.rs` | What goes up to copies in the card's memory goes up as it was when its submission was prepared (`LEONIDA_SEND_OWN`, on by default; `0`: as before). | +| `LEONIDA_SEND_TAKE_BESIDE` | see the code | yes | | yes | `leonida-gpu/host.rs` +1 | `LEONIDA_SEND_TAKE_BESIDE=0`: waited for in `take`, as before; `check`: the bytes are compared with where they came from when they are waited for, which reads upload memory and is slow; `LEONIDA_AB` can name it). | +| `LEONIDA_SHADER_SAVE` | see the code | | | | `leonida-gpu/pipeline.rs` +1 | `LEONIDA_SHADER_SAVE=<dir>`: each shader as the title gave it (`.cdxil`) and as translated (`.dxil`), by the hash crash reports name it with | +| `LEONIDA_SHARPEN` | see the code | | | | `leonida-gpu/compose.rs` | Leonida: the scene sharpened before the interface goes over it (SHARPEN, 0 to 1, set when the pass is made from LEONIDA_SHARPEN). | +| `LEONIDA_SHOW_AFTER` | see the code | | yes | yes | `leonida-gpu/descriptor/host.rs` +4 | Whether a title slot shows a texture that is new to it only once the submission with its upload has finished (`LEONIDA_SHOW_AFTER=1`; off). | +| `LEONIDA_SHOW_NEW_LATER` | see the code | yes | | | `leonida-gpu/descriptor/host.rs` | ...e it may still run shows it only once those have finished (`LEONIDA_SHOW_NEW_LATER`, on; 0: at once, as before; A/B-able). [`show_after`] left out slots made "at once" from a draw's table, the texture pass's paths that a... | +| `LEONIDA_SKIP_KEPT` | see the code | | | | `leonida-gpu/pipeline.rs` | `LEONIDA_SKIP_KEPT=0`: looked up each time, as before. | +| `LEONIDA_SKIP_PIPELINES` | see the code | | | | `leonida-gpu/drops.rs` +3 | Timing experiment: the pipelines with a shader that `LEONIDA_SKIP_TRY_A`, `_B` or `_C` names (hashes, as for `LEONIDA_SKIP_PIPELINES`) are left out while that switch is on. | +| `LEONIDA_SKIP_RT_SHADOW` | see the code | | | | `leonida-gpu/pipeline/make.rs` | Whether the traced shadow passes ([`RT_SHADOW_NAMES`]) are left out (`LEONIDA_SKIP_RT_SHADOW=1`; off by default: they run, as before). | +| `LEONIDA_SKIP_TRY_A` | see the code | | | yes | `leonida-gpu/pipeline.rs` | Timing experiment: the pipelines with a shader that `LEONIDA_SKIP_TRY_A`, `_B` or `_C` names (hashes, as for `LEONIDA_SKIP_PIPELINES`) are left out while that switch is on. | +| `LEONIDA_SKIP_TRY_B` | see the code | | | | `leonida-gpu/pipeline.rs` | Each is a switch of `LEONIDA_AB` (`LEONIDA_AB=15,LEONIDA_SKIP_TRY_A,LEONIDA_SKIP_TRY_B`) and does nothing when it is not named there: a phase's frame time against the next one's says what those programs cost the card in... | +| `LEONIDA_SKIP_TRY_C` | see the code | | | | `leonida-gpu/pipeline.rs` | | +| `LEONIDA_SLOT_CHECK` | see the code | | | | `leonida-gpu/book.rs` | ...every slot of the view heap whose descriptor reaches it. - `LEONIDA_SLOT_CHECK=1`: a thread walks the view heap and says which slots name memory that is gone, while nothing is lost yet ([`check`]).... | +| `LEONIDA_SLOT_HOLDS` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_SLOT_HOLDS=0`: only the list holds it, as before. | +| `LEONIDA_SLOT_SETTLE` | on, `0` turns it off | yes | | | `leonida-gpu/host.rs` | `LEONIDA_SLOT_SETTLE=0`: refused without the wait. | +| `LEONIDA_SMALL_BUFFER_POOL` | on, `0` turns it off | yes | | yes | `leonida-gpu/host.rs` +1 | Small upload and shared buffers placed in blocks made once (`LEONIDA_SMALL_BUFFER_POOL`), after trustno1-coder/VIctory-NVIDIA 95509b9 (GPL-3.0), which cut upload and shared buffers of up to 4 MiB from pooled 64 MiB heaps... | +| `LEONIDA_SNAPSHOT_POOL` | see the code | | | | `leonida-gpu/shadow.rs` | How many snapshot buffers are kept (`LEONIDA_SNAPSHOT_POOL`; `8`: as before). | +| `LEONIDA_SPANS_QUICK` | off unless set and not `0` | yes | | yes | `leonida-gpu/descriptor/host.rs` | Off by default (`LEONIDA_SPANS_QUICK=1`; `LEONIDA_AB` can name it): here the lock was not waited for, and in four runs by turns the submitting thread worked 0.12 to 0.30 ms a frame more with it (runs d41, d43; `docs/find... | +| `LEONIDA_SPLIT_WAITS` | see the code | | | | `leonida-gpu/queue.rs` | `LEONIDA_SPLIT_WAITS=0` holds whole submissions, as before. | +| `LEONIDA_STALE_TEXTURES` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_STALE_TEXTURES=overlap`. | +| `LEONIDA_STATE_CACHE` | on, `0` turns it off | yes | | | `leonida-gpu/copystat.rs` +1 | What a host list was last given for its root parameters and its vertex and index buffers, so that a draw that sets the same value again records nothing (`LEONIDA_STATE_CACHE=0`: every call is recorded, as before). | +| `LEONIDA_STATIC_SAMPLERS_LINEAR` | see the code | | yes | yes | `leonida-gpu/pipeline/host.rs` +1 | `LEONIDA_STATIC_SAMPLERS_LINEAR`: immediate samplers of the title's shaders filter linearly in minification, magnification and mips (anisotropic ones keep their filter; the reduction and comparison bits stay, so a point... | +| `LEONIDA_STEP_GATHER` | off unless set and not `0` | yes | | | `leonida-gpu/host/card_steps.rs` | Whether a level's reads go into the buffer between by one dispatch for each host copy read, not by a copy command each (`LEONIDA_STEP_GATHER=1`; off by default; `LEONIDA_AB` can name it). | +| `LEONIDA_STORE_BESIDE` | see the code | | yes | yes | `leonida-gpu/titlewrite.rs` +1 | ...hat faults is done here, and the thread goes on behind it (`LEONIDA_STORE_BESIDE=1`; off unless asked for).... | +| `LEONIDA_STREAMLINE_DIR` | see the code | | | | `leonida-gpu/dlss.rs` +2 | `LEONIDA_FRAME_GEN=2\|3\|4` (frames shown per rendered one; unset or 1: off) with the SDK's signed DLLs in `LEONIDA_STREAMLINE_DIR` (sl.interposer, sl.common, sl.dlss_g, sl.reflex, sl.pcl, nvngx_dlssg). | +| `LEONIDA_STRICT_JOINS` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | ...lue, was zero in every lane that way). shortcut: only with `LEONIDA_STRICT_JOINS` set (the offline pack listing sets it to count them): 40 programs that translate today stop by name with it (vehicle paint pixel shaders a... | +| `LEONIDA_STRUCTURED_BYTES` | see the code | | | | `leonida-gpu/descriptor/host.rs` | Off unless `LEONIDA_STRUCTURED_BYTES=1`: it leaves such a view structured on its buffer's copy, as before. | +| `LEONIDA_SUBMIT_DEPTH` | see the code | | | | `leonida-gpu/queue/behind.rs` | How many submissions may be in the line when a submit call returns (`LEONIDA_SUBMIT_DEPTH`; 64: about two frames of the title's). | +| `LEONIDA_SUBMIT_FRAMES` | see the code | yes | | | `leonida-gpu/queue/behind.rs` | How many presents may be in the line when a present call returns (`LEONIDA_SUBMIT_FRAMES`; 1: the frame before is sent, this one may not be; 0: both are). | +| `LEONIDA_SWEEP` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_SWEEP=0` keeps everything, as before. | +| `LEONIDA_SWEEP_SPANS` | on, `0` turns it off | yes | | | `leonida-gpu/draw.rs` | ...n the part cover, and joins those for the spans of a pass (`LEONIDA_SWEEP_SPANS=0`: the spans are made from every slot's range at every pass, as before, and a written slot that is also of the pass's part is looked at twi... | +| `LEONIDA_SWEEP_WRAP` | on, `0` turns it off | yes | | | `leonida-gpu/resource.rs` | ...s released) starts again at the first address when `wrap` (`LEONIDA_SWEEP_WRAP=0`: it stayed past the end, as before, and the sweep looked at nothing).... | +| `LEONIDA_TABLED_TEXTURES` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_TABLED_TEXTURES=1` keeps them in it as before. | +| `LEONIDA_TABLES_EARLY` | on, `0` turns it off | yes | | | `leonida-gpu/host.rs` | `LEONIDA_TABLES_EARLY=0`: at the end of the landing, as before. | +| `LEONIDA_TAKE_PARTS` | on, `0` turns it off | yes | | | `leonida-gpu/watch.rs` | Of a page taken before, the parts written since, where they are known (`LEONIDA_TAKE_PARTS=0`: the page). | +| `LEONIDA_TARGET_VARIANTS` | see the code | | | | `leonida-gpu/pipeline/make.rs` | Whether a draw into views of other formats than its pipeline declares gets a host pipeline for those formats ([`for_formats`]); on unless `LEONIDA_TARGET_VARIANTS=0`. | +| `LEONIDA_TEARING` | off unless set and not `0` | | | | `leonida-gpu/host.rs` | `LEONIDA_TEARING=1`, where the system has it; off by default (unset or `0`: presents wait for the refresh, as before). | +| `LEONIDA_TELL_EARLY` | see the code | yes | | | `leonida-gpu/host.rs` | ...at their shaders wrote is back in title memory, not after (`LEONIDA_TELL_EARLY=1`, or by turns with `LEONIDA_AB=<s>,LEONIDA_TELL_EARLY`; off by default).... | +| `LEONIDA_TEXBACK_ASYNC` | see the code | | | | `leonida-gpu/land.rs` +1 | Writing texture read-backs into title memory (`texback::write`, on its own thread unless `LEONIDA_TEXBACK_ASYNC=0`): waiting for the locks against mapping changes, the work after, read-backs written, and those replaced b... | +| `LEONIDA_TEXBACK_LIGHT` | on, `0` turns it off | yes | | | `leonida-gpu/texback.rs` | Whether read-backs go the light way (`LEONIDA_TEXBACK_LIGHT=0`: as before): a read-back is tiled outside the tickets' lock, which is taken for the write into title memory alone, into memory its thread keeps; and of a lis... | +| `LEONIDA_TEXTURE_AWAY_MS` | see the code | | | | `leonida-gpu/descriptor/host.rs` | Only when it is still away `AWAY_MS` after it was first found away (`LEONIDA_TEXTURE_AWAY_MS`; 0: at once, as before). | +| `LEONIDA_TEXTURE_BACK` | see the code | | | | `leonida-gpu/texback.rs` | For textures of the kinds in `LEONIDA_TEXTURE_BACK` (comma-separated `<width>x<height>f<format>`; unset or `1`: the four water formats found by the upstream trace; `0`: none), a list in which shaders write one copies it... | +| `LEONIDA_TEXTURE_BUDGET_MB` | see the code | | | | `leonida-gpu/resource.rs` | The limit `LEONIDA_TEXTURE_BUDGET_MB` sets on the bytes of host copies of the title's textures, if it is set. | +| `LEONIDA_TEXTURE_CATCHUP` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_TEXTURE_CATCHUP=0` keeps the plain budget. | +| `LEONIDA_TEXTURE_COPY` | see the code | | | | `leonida-gpu/texture.rs` | Whether a texture all of whose memory is mapped is read through the kernel's copy instead of in place (`LEONIDA_TEXTURE_COPY=1`; off by default). | +| `LEONIDA_TEXTURE_FAVOR_REUSED` | off unless set and not `0` | yes | | | `leonida-gpu/resource.rs` | `LEONIDA_TEXTURE_FAVOR_REUSED=1`; off by default; `LEONIDA_AB` can name it). | +| `LEONIDA_TEXTURE_FILL` | see the code | | | | `leonida-gpu/texture.rs` | Whether a refresh that does not wait ([`no_wait`]) and finds a page missing fills a staging buffer that was never filled from the pages that are there (`LEONIDA_TEXTURE_FILL=0`: it was left as it was made). | +| `LEONIDA_TEXTURE_GUARD` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_TEXTURE_GUARD=0` hashes at every check, as before. | +| `LEONIDA_TEXTURE_HASH_BACKOFF` | off unless set and not `0` | yes | yes | yes | `leonida-gpu/texture.rs` +1 | ...s, takes only one of every [`backoff_every`] of its turns (`LEONIDA_TEXTURE_HASH_BACKOFF`, off unless asked; `LEONIDA_AB` can turn it while the title runs).... | +| `LEONIDA_TEXTURE_HASH_BACKOFF_AFTER` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_TEXTURE_HASH_BACKOFF_AFTER`, 4). | +| `LEONIDA_TEXTURE_HASH_BACKOFF_N` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_TEXTURE_HASH_BACKOFF_N`, 16). | +| `LEONIDA_TEXTURE_HOT` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_TEXTURE_HOT=0`: every eighth frame only, as before. | +| `LEONIDA_TEXTURE_KEEP` | see the code | | | | `leonida-gpu/host.rs` +1 | `LEONIDA_TEXTURE_KEEP=0`: [`vram_idle_ms`]' older rule, all that are idle; `=1`: that rule with its two longer times. | +| `LEONIDA_TEXTURE_NO_WAIT` | see the code | | yes | | `leonida-gpu/host/menu.rs` +3 | Whether a texture refresh that finds the runtime remapping title memory goes on without waiting for it (`LEONIDA_TEXTURE_NO_WAIT=1`; off by default). | +| `LEONIDA_TEXTURE_ONCE` | see the code | | | | `leonida-gpu/texture.rs` | Whether a staging buffer made for one upload of a texture picked by index is filled without asking the write watch and the guards (`LEONIDA_TEXTURE_ONCE=0`: with, as before). | +| `LEONIDA_TEXTURE_POOL` | see the code | | | | `leonida-gpu/pool.rs` | `LEONIDA_TEXTURE_POOL=0` makes every one an allocation of its own again. | +| `LEONIDA_TEXTURE_ROOM_PERCENT` | see the code | | | | `leonida-gpu/resource.rs` +1 | The share of the card's budget, in percent, up to which host copies of textures picked by index are made ([`room`]): 90 unless `LEONIDA_TEXTURE_ROOM_PERCENT` says another (50 to 97). | +| `LEONIDA_TEXTURE_SAME` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_TEXTURE_SAME=0`: not asked. | +| `LEONIDA_TEXTURE_STAGE_MB` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_TEXTURE_STAGE_MB` sets it: a backlog of tens of thousands of textures (a scene's first minutes) then drains in fewer frames. | +| `LEONIDA_TEXTURE_STAGE_MS` | see the code | | | | `leonida-gpu/draw.rs` | | +| `LEONIDA_TEXTURE_SWEEP` | see the code | | | | `leonida-gpu/resource.rs` | `LEONIDA_TEXTURE_SWEEP=0` lets nothing go. | +| `LEONIDA_THIN` | see the code | | yes | yes | `leonida-gpu/draw.rs` +7 | List calls that only write down their arguments (`LEONIDA_THIN=1`); what they mean is worked out by threads of ours, beside the title's. | +| `LEONIDA_THIN_PARK` | off unless set and not `0` | yes | | yes | `leonida-gpu/list/thin.rs` +1 | Whether thread `i` of the `threads` that translate takes no work now: with `LEONIDA_THIN_PARK` (off unless asked for; by turns under A/B) the last `LEONIDA_THIN_PARK_N` (2) of them sleep, so that one run measures fewer t... | +| `LEONIDA_THIN_PARK_N` | see the code | | | | `leonida-gpu/list/thin.rs` | ..._PARK` (off unless asked for; by turns under A/B) the last `LEONIDA_THIN_PARK_N` (2) of them sleep, so that one run measures fewer threads against all of them.... | +| `LEONIDA_THIN_THREADS` | see the code | | yes | yes | `leonida-gpu/list/thin.rs` +1 | | +| `LEONIDA_THREAD_DIMENSIONS` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_THREAD_DIMENSIONS=0`: such counts are taken for groups, as before. | +| `LEONIDA_THREAD_TICKET` | see the code | | | | `leonida-gpu/shader_cache.rs` +2 | `LEONIDA_THREAD_TICKET=0`: the flat id of the wave's first lane rounded down, as before. | +| `LEONIDA_TILES_TEST_CARD` | see the code | | | | `leonida-gpu/tiles.rs` | `cargo test -p leonida-gpu --release -- --ignored levels_on_demand --nocapture` It runs on the SOFTWARE adapter unless `LEONIDA_TILES_TEST_CARD=1`: on that adapter nothing reaches the card or its driver, so nothing it do... | +| `LEONIDA_TIMELINE` | see the code | | | yes | `leonida-gpu/timeline.rs` +2 | `LEONIDA_TIMELINE=<file>` writes one, from the first present after `LEONIDA_TIMELINE_AT` seconds (60) on and for `LEONIDA_TIMELINE_FRAMES` frames (3); `LEONIDA_TIMELINE=<from s>[+<from s>..],<frames>,<file>` one for each... | +| `LEONIDA_TIMELINE_AT` | see the code | | | | `leonida-gpu/timeline.rs` +1 | `LEONIDA_TIMELINE=<file>` writes one, from the first present after `LEONIDA_TIMELINE_AT` seconds (60) on and for `LEONIDA_TIMELINE_FRAMES` frames (3); `LEONIDA_TIMELINE=<from s>[+<from s>..],<frames>,<file>` one for each... | +| `LEONIDA_TIMELINE_FRAMES` | see the code | | | | `leonida-gpu/timeline.rs` +1 | `LEONIDA_TIMELINE=<file>` writes one, from the first present after `LEONIDA_TIMELINE_AT` seconds (60) on and for `LEONIDA_TIMELINE_FRAMES` frames (3); `LEONIDA_TIMELINE=<from s>[+<from s>..],<frames>,<file>` one for each... | +| `LEONIDA_TITLE_PRIORITIES` | see the code | | | | `leonida-gpu/host/menu.rs` +3 | `LEONIDA_TITLE_PRIORITIES=0`: as the title sets them. | +| `LEONIDA_TRAIL` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_TRAIL=0`: nothing is kept and nothing is said. | +| `LEONIDA_TRANSLATOR` | see the code | | | | `leonida-gpu/shader_cache.rs` | | +| `LEONIDA_TWIN_BIAS` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_TWIN_BIAS=0`: null, as before (programs then add a bias of 0). | +| `LEONIDA_UNDER_THREADS` | see the code | | | yes | `leonida-gpu/land.rs` | [`Pool::each`] on threads kept for the title's bytes under flights' writes (`LEONIDA_UNDER_THREADS`, 6 with this one). | +| `LEONIDA_UNDER_WIDE` | on, `0` turns it off | yes | | | `leonida-gpu/shadow.rs` +1 | Whether the pages of [`Shadow::merge_under_writes`] are compared on several threads (`LEONIDA_UNDER_WIDE=0`: on the submitting one). | +| `LEONIDA_UNDER_WORDS` | see the code | | | | `leonida-gpu/host/send.rs` | Whether the title's bytes that go in under flights' writes (`Shadow::merge_under_writes`) go in by whole words (`LEONIDA_UNDER_WORDS=0`: by the bytes that changed, as before). | +| `LEONIDA_UNGUARD_RUNS` | on, `0` turns it off | yes | | | `leonida-gpu/watch.rs` | Whether guarded blocks that follow each other are given write access back by one change of protection (`LEONIDA_UNGUARD_RUNS=0`: a change a block, as before). | +| `LEONIDA_UNIFORM_LOADS` | see the code | | | yes | `leonida-gpu/shader_cache.rs` +1 | Whether buffer loads of read-only views at an address the lanes hold alike count as the same in every lane (`LEONIDA_UNIFORM_LOADS`, on unless `0`): a first-lane read of such a value then needs nothing from the other hos... | +| `LEONIDA_UNWATCHED_FRAMES` | see the code | | | | `leonida-gpu/draw.rs` | | +| `LEONIDA_UPCOPY_CHECK` | see the code | | | | `leonida-gpu/host/upcheck.rs` | Diagnostics (`LEONIDA_UPCOPY_CHECK=1`; off by default): whether what goes up to a copy in the card's memory is older than what the card holds. | +| `LEONIDA_UPLOAD_AHEAD` | see the code | yes | | | `leonida-gpu/draw.rs` +5 | First uploads of textures picked by index on a copy queue of their own (`LEONIDA_UPLOAD_AHEAD`): read, detiled and copied by threads of ours as soon as the texture pass has made them, and the slots that wait for them sho... | +| `LEONIDA_UPLOAD_GUARD` | on, `0` turns it off | yes | | yes | `leonida-gpu/texture.rs` | `LEONIDA_UPLOAD_GUARD=0`: made, as before; `LEONIDA_AB` can turn it while the title runs, the writes are noted either way). | +| `LEONIDA_UPLOAD_LOW` | see the code | | | | `leonida-gpu/upload.rs` | `LEONIDA_UPLOAD_LOW=0`: from the process heap, as before. | +| `LEONIDA_UPSCALE_PROBE` | see the code | | | yes | `leonida-gpu/list.rs` +1 | `LEONIDA_UPSCALE_PROBE=1`: logs what the title gives each upscale (the inputs a temporal upscaler such as DLSS or FSR 2 needs), now and then. | +| `LEONIDA_VIDEO_HOT_FRAMES` | see the code | | | | `leonida-gpu/texture.rs` | LOCAL (wt5 build38, bodnjenie14 12457b43 "Bink video flickering"): after the hash finds a change the guard did not see, the texture stays hot this many frames (`LEONIDA_VIDEO_HOT_FRAMES`, 1,024 unless said; 64 before). | +| `LEONIDA_VIDEO_PLANES` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_VIDEO_PLANES=0`: as before. | +| `LEONIDA_VIEW_BYTES` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_VIEW_BYTES=0` leaves them null, as before. | +| `LEONIDA_VIEW_CACHE` | off unless set and not `0` | yes | | yes | `leonida-gpu/descriptor.rs` | Off unless `LEONIDA_VIEW_CACHE=1`; by turns under A/B. | +| `LEONIDA_VIEW_COPY` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_VIEW_COPY=0`: made in place, as before. | +| `LEONIDA_VIEW_EXTENT` | see the code | | | | `leonida-gpu/descriptor/host.rs` +1 | `LEONIDA_VIEW_EXTENT=0` looks the copy up by the view's range alone, as before. | +| `LEONIDA_VIEW_GUARD` | see the code | | | | `leonida-gpu/watch.rs` | `LEONIDA_VIEW_GUARD=0`: each address for itself, as before. | +| `LEONIDA_VIEW_INLINE` | see the code | | | | `leonida-gpu/descriptor.rs` | `LEONIDA_VIEW_INLINE=0`: every view is an entry, as before. | +| `LEONIDA_VIEW_THREADS` | see the code | | | | `leonida-gpu/land.rs` | Calls `f` with every number below `count`, on this thread and on threads kept for making descriptors (`LEONIDA_VIEW_THREADS`, 4 with this one, 6 for records; 1: on this one alone). | +| `LEONIDA_VIEW_THREADS_WIDE` | see the code | | | yes | `leonida-gpu/land.rs` | Threads of the pool for the views picked by index ([`each_view`]): as before, and with `LEONIDA_VIEW_THREADS_WIDE=1`. | +| `LEONIDA_VIPATCH_NO_VIGNETTE` | see the code | | | | `leonida-gpu/host/menu.rs` +1 | | +| `LEONIDA_VOLUME_VIEWS` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_VOLUME_VIEWS=0`: not. | +| `LEONIDA_WAIT_ASK` | see the code | | | | `leonida-gpu/list.rs` | `LEONIDA_WAIT_ASK=1` asks first, as before. | +| `LEONIDA_WAIT_FORCE` | see the code | | | | `leonida-gpu/queue.rs` | `LEONIDA_WAIT_FORCE=0` keeps it held: for finding out whether the title's waits reach across its presents; a wait nothing ever meets then stops the title for good. | +| `LEONIDA_WAIT_RESIDENT` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_WAIT_RESIDENT=0`: as before). | +| `LEONIDA_WALLS_TRACE` | see the code | | | | `leonida-gpu/host.rs` +1 | The walls trace (`LEONIDA_WALLS_TRACE=1` or `2`; off by default): log lines that say what the title's CPU was given while it decided whether the camera is in a room. | +| `LEONIDA_WAVE_DEEP_SKIPS` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | (`LEONIDA_WAVE_DEEP_SKIPS=0` and `LEONIDA_WAVE_WIDE=0` turn the two off.) | +| `LEONIDA_WAVE_LDS_LOOSE` | see the code | | | yes | `leonida-gpu/shader_cache.rs` +1 | Leonida, last of all, only with `LEONIDA_WAVE_LDS_LOOSE=1`: LDS read and written inside one lane-branch region, the host waves meeting only around it (`lower::with_lds_loose`, approximate). | +| `LEONIDA_WAVE_LOCAL` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | `LEONIDA_WAVE_LOCAL=idiom` refuses those instead. | +| `LEONIDA_WAVE_OWN_BITS` | see the code | | | | `leonida-gpu/shader_cache.rs` +2 | `LEONIDA_WAVE_OWN_BITS=0`: a wave OR where not every lane runs is refused as before ([`super::own_bits`]). | +| `LEONIDA_WAVE_WIDE` | see the code | | | yes | `leonida-gpu/shader_cache.rs` +1 | So are the switches that pick the form of a wave64 program: without them here a run with `LEONIDA_WAVE_WIDE=0` was served the translations an earlier run of the same executable had cached with the switch unset. | +| `LEONIDA_WAVE_WIDE_FOR` | see the code | | | yes | `leonida-gpu/shader_cache.rs` +1 | The programs a `LEONIDA_PAIRED_FOR` or `LEONIDA_WAVE_WIDE_FOR` list names: hashes as the log and the frame listings name shaders (the first 16 hex digits of the container's BLAKE3), or their beginnings from 8 digits on,... | +| `LEONIDA_WC_NO_BACK` | on, `0` turns it off | yes | yes | yes | `leonida-gpu/shadow.rs` +3 | Whether its title memory is write-combined ([`Shadow::write_combined`], `LEONIDA_WC_NO_BACK`): 0 not known yet, 1 no, 2 yes. | +| `LEONIDA_WC_NO_BACK_MIN_KB` | see the code | | | | `leonida-gpu/shadow.rs` | The smallest copy whose shader writes [`wc_no_back`] leaves on the card, in bytes (`LEONIDA_WC_NO_BACK_MIN_KB`, 1024 unless set; 0: all). | +| `LEONIDA_WIDE_BACK` | see the code | | yes | | `leonida-gpu/host/menu.rs` +3 | Whether the snapshots of a submission's shader-written ranges, and the compare that finds what the shaders wrote, run on several threads across ranges (`LEONIDA_WIDE_BACK=1`; off by default). | +| `LEONIDA_WIDE_FILLS` | see the code | | | | `leonida-gpu/host.rs` | Whether the fills of a submission's upload memory are done together on several threads (`LEONIDA_WIDE_FILLS=0`: one after the other, where the lists name them). | +| `LEONIDA_WIDE_HALF` | off unless set and not `0` | yes | | yes | `leonida-gpu/shadow.rs` | Whether half of the logical processors help with work spread over threads, not a quarter of them (`LEONIDA_WIDE_HALF=1`; off by default; `LEONIDA_AB` can name it: the threads are all kept then, and half of them are left... | +| `LEONIDA_WIDE_MERGE` | see the code | | | | `leonida-gpu/host.rs` | Whether what shaders wrote to copies in the card's memory is merged into title memory on several threads (`LEONIDA_WIDE_MERGE=1`; off by default). | +| `LEONIDA_WIDE_REFRESH` | see the code | | | | `leonida-gpu/host.rs` | Whether a submission's refreshes of host copies run on several threads, a copy to a thread (`LEONIDA_WIDE_REFRESH=0` disables it; `=1` forces it). | +| `LEONIDA_WIDE_SPIN` | see the code | | | | `leonida-gpu/shadow.rs` +1 | Waits awake until `there` says so, `LEONIDA_WIDE_SPIN` microseconds at most (0, the default: not at all): asleep, a thread is woken in 50 us and more, 95 times a frame. | +| `LEONIDA_WIDE_TEXTURES` | see the code | | | | `leonida-gpu/host.rs` | Whether a submission's textures are brought up to date on several threads (`LEONIDA_WIDE_TEXTURES=0`: one after the other, where the lists name them, as before). | +| `LEONIDA_WIDE_THREADS` | see the code | | | | `leonida-gpu/shadow.rs` | `LEONIDA_WIDE_THREADS=<n>`: that many helper threads, whatever the PC has. | +| `LEONIDA_WINDOWS_BAR_MB` | see the code | | | yes | `leonida-gpu/shadow.rs` +1 | The most bytes of windows outside buffers that lie in the card's memory and are filled by the CPU through the bus (`LEONIDA_WINDOWS_BAR_MB`; 0, the default, none): one buffer (`D3D12_HEAP_TYPE_GPU_UPLOAD`), no CPU's side... | +| `LEONIDA_WINDOWS_OWN` | see the code | | | | `leonida-gpu/shadow.rs` | Whether windows outside buffers have two sides too, so that submissions in the air read the bytes they were prepared with (`LEONIDA_WINDOWS_OWN=1`; off by default: it takes the windows' bytes again, 3.3 GB in capture rep... | +| `LEONIDA_WINDOW_KB` | see the code | | | | `leonida-gpu/shadow.rs` | The grid the windows of asks with a length are cut on, in bytes: 4 MiB unless `LEONIDA_WINDOW_KB` names a smaller power of two (64 at least). | +| `LEONIDA_WINDOW_TAILS` | see the code | | | | `leonida-gpu/shadow.rs` | ... goes when nothing holds it any more. shortcut: off unless `LEONIDA_WINDOW_TAILS=1`.... | +| `LEONIDA_WRITE_SITES` | see the code | | | yes | `leonida-gpu/titlewrite.rs` +1 | With `LEONIDA_WRITE_SITES=<file>`, a place that can be made to look first (`can_look`) and mostly left it is written into that file, for the next start (`leonida_loader::write_sites`). | +| `LEONIDA_WRITE_SKIP` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_WRITE_SKIP=0` declares every such range, as before. | + +## leonida-hle + +| Name | Kind | A/B | L | F | Named in | In the code's words | +|---|---|---|---|---|---|---| +| `LEONIDA_ALIAS_CHUNK` | off unless set and not `0` | | | | `leonida-hle/modules/xmem.rs` | `LEONIDA_ALIAS_CHUNK=<pages>`, 16 unless set; 0: the whole range at once, as before. | +| `LEONIDA_ALIAS_SAME` | off unless set and not `0` | | | | `leonida-hle/modules/xmem.rs` | Whether [`map_alias`] leaves a page mapped that shows the page it is to show already (`LEONIDA_ALIAS_SAME=0`: unmapped and mapped again, as before). | +| `LEONIDA_AUDIO_CAPTURE_OF` | see the code | | | | `leonida-hle/modules/audio/capture.rs` | | +| `LEONIDA_BCPACK_DUMP` | see the code | | | yes | `leonida-hle/modules/dstorage.rs` | Leonida: with `LEONIDA_BCPACK_DUMP=<folder>`, the first 400 BCPack streams of each BC format are written there as they come (`bc<n>-<k>.bin`: the format and the unpacked size as two little-endian u32, then the stream), t... | +| `LEONIDA_DSP_CONVOLVE` | see the code | | | | `leonida-hle/modules/dsp.rs` | `LEONIDA_DSP_CONVOLVE=0` turns that off. shortcut: stereo and 512-frame convolutions and the other block transforms are not computed; their outputs are zeros. | +| `LEONIDA_DSP_GAIN` | see the code | | | | `leonida-hle/modules/dsp.rs` | `LEONIDA_DSP_GAIN`, else 2. | +| `LEONIDA_DSTORAGE_HALF` | see the code | | | | `leonida-hle/modules/dstorage.rs` | Whether a queue submits itself once half of it is enqueued (`LEONIDA_DSTORAGE_HALF=1`), as DirectStorage for the PC does and as ours did. | +| `LEONIDA_DSTORAGE_IO` | see the code | | | | `leonida-hle/modules/dstorage.rs` | How files are read (`LEONIDA_DSTORAGE_IO`). | +| `LEONIDA_DSTORAGE_LOG` | see the code | | | | `leonida-hle/modules/dstorage.rs` | The streaming log (`LEONIDA_DSTORAGE_LOG=<file>`): a line for every request (`R`: queue, number, file, offset, source bytes, destination bytes, options, when enqueued, submitted, started, done, result), every status entr... | +| `LEONIDA_DSTORAGE_RETRIES` | see the code | | | | `leonida-hle/modules/dstorage.rs` | ...ight a little later: tried again before the request fails (`LEONIDA_DSTORAGE_RETRIES`, default 12, about 1.5 s in all).... | +| `LEONIDA_DSTORAGE_STAGING_MB` | see the code | | | | `leonida-hle/modules/dstorage.rs` | | +| `LEONIDA_DSTORAGE_TRACE` | see the code | | | | `leonida-hle/modules/dstorage.rs` | The streaming trace (`LEONIDA_DSTORAGE_TRACE`): 0 or unset: off; 1: a line for every batch, and for every request whose page list, or whose pages' mapping, changed when it should not have, or whose bytes another running... | +| `LEONIDA_EFFICIENCY_MODE` | see the code | | | | `leonida-hle/runtime.rs` | `LEONIDA_EFFICIENCY_MODE=1` leaves the system its choice. | +| `LEONIDA_GAMEPAD_MOUSE` | see the code | | | | `leonida-hle/modules/gameinput.rs` | | +| `LEONIDA_IMAGE_WATCH` | see the code | | | | `leonida-hle/image_watch.rs` | Diagnostics (`LEONIDA_IMAGE_WATCH`; off by default): words of the title's image, logged once a second, for what a launch's own counters say (how much of its streaming memory it uses, whether an allocation failed) where t... | +| `LEONIDA_KBM` | see the code | | | | `leonida-hle/modules/gameinput.rs` +1 | `LEONIDA_KBM=classic` brings back the single table of before ([`super::fallback`]); `LEONIDA_KBM_DRIVE=on\|off\|auto` forces the driving table on or off (a test), `auto` being the default; `LEONIDA_KBM_SETTLE_MS` (400; 0..... | +| `LEONIDA_KBM_DRIVE` | see the code | | | | `leonida-hle/modules/gameinput.rs` +1 | `LEONIDA_KBM_DRIVE=on\|off\|auto` forces the driving table on or off (a test), `auto` being the default; `LEONIDA_KBM_SETTLE_MS` (400; 0..3000) is the pause after a change. | +| `LEONIDA_KBM_SETTLE_MS` | see the code | | | | `leonida-hle/modules/gameinput/kbm.rs` | `LEONIDA_KBM_SETTLE_MS` (400; 0..3000) is the pause after a change. | +| `LEONIDA_KEYS` | see the code | | | | `leonida-hle/modules/gameinput.rs` +1 | The scripted keys (`LEONIDA_KEYS`) also press the first pad's buttons, by the stand-in pad's table: with a real pad connected the stand-in is not there, and a title that listens to the pad (the title's start screen) saw... | +| `LEONIDA_MAP_LEAN` | see the code | | | | `leonida-hle/modules/xmem.rs` | Whether a mapping change asks the host only for what it needs: no split of a placeholder that is already the view's own, no commit of section pages that are committed (`LEONIDA_MAP_LEAN=0`: both every time, as before). | +| `LEONIDA_MOUSE_CURVE` | see the code | | | | `leonida-hle/modules/gameinput.rs` | `LEONIDA_MOUSE_SENSITIVITY` (1; 0.1..10), `LEONIDA_MOUSE_DEADZONE` (0.24), `LEONIDA_MOUSE_CURVE` (0.6), `LEONIDA_MOUSE_INVERT_Y` (0). | +| `LEONIDA_MOUSE_DEADZONE` | see the code | | | | `leonida-hle/modules/gameinput.rs` | `LEONIDA_MOUSE_SENSITIVITY` (1; 0.1..10), `LEONIDA_MOUSE_DEADZONE` (0.24), `LEONIDA_MOUSE_CURVE` (0.6), `LEONIDA_MOUSE_INVERT_Y` (0). | +| `LEONIDA_MOUSE_INVERT_Y` | see the code | | | | `leonida-hle/modules/gameinput.rs` | `LEONIDA_MOUSE_SENSITIVITY` (1; 0.1..10), `LEONIDA_MOUSE_DEADZONE` (0.24), `LEONIDA_MOUSE_CURVE` (0.6), `LEONIDA_MOUSE_INVERT_Y` (0). | +| `LEONIDA_MOUSE_LOOK` | see the code | | | | `leonida-hle/modules/gameinput.rs` | `LEONIDA_MOUSE_LOOK=0` turns mouse look off (and with it the click that takes the mouse). | +| `LEONIDA_MOUSE_SENSITIVITY` | see the code | | | | `leonida-hle/modules/gameinput.rs` | `LEONIDA_MOUSE_SENSITIVITY` (1; 0.1..10), `LEONIDA_MOUSE_DEADZONE` (0.24), `LEONIDA_MOUSE_CURVE` (0.6), `LEONIDA_MOUSE_INVERT_Y` (0). | +| `LEONIDA_ONE_PAD` | see the code | | | | `leonida-hle/modules/gameinput.rs` | `LEONIDA_ONE_PAD=0` shows each host pad as a device of its own, and the stand-in only while there is none). | +| `LEONIDA_PAD_QUICK` | see the code | | | | `leonida-hle/modules/gameinput.rs` | ... counts), the keyboard and mouse every [`POLL`] as before (`LEONIDA_PAD_QUICK=0`: everything every [`POLL`]).... | +| `LEONIDA_PC_GLYPHS` | see the code | | | | `leonida-hle/modules/glyphs.rs` +1 | ...hs.py` \| \| keyboard and mouse \| `pc_prompt_glyphs.gfx`, or `LEONIDA_PC_GLYPHS` \| `tools/pc_prompt_glyphs.py` \| How the swap finds the stream without the archive's table of contents (encrypted, and not used by this port):... | +| `LEONIDA_PROCESS_PRIORITY` | see the code | | | | `leonida-hle/runtime.rs` | `LEONIDA_PROCESS_PRIORITY=normal`: as it was started. | +| `LEONIDA_PROMPTS` | see the code | | | | `leonida-hle/modules/gameinput.rs` +2 | ...at once cannot make the answer flicker faster than that; - `LEONIDA_PROMPTS` forces a family (`xbox`, `playstation` or `ps5`/`ps4`/`ps3`, `keyboard`); `auto` follows the devices.... | +| `LEONIDA_PROMPTS_SWITCH_MS` | see the code | | | | `leonida-hle/modules/gameinput/family.rs` | Only the change after it waits, `LEONIDA_PROMPTS_SWITCH_MS` (300 ms) from that switch: input from another family inside that time is ignored, not queued, so two devices used at once cannot make the answer flicker faster... | +| `LEONIDA_PS_GLYPHS` | see the code | | | | `leonida-hle/modules/glyphs.rs` +1 | ...he archive) \| \| \| PlayStation \| `ps_prompt_glyphs.gfx`, or `LEONIDA_PS_GLYPHS` \| `tools/ps_prompt_glyphs.py` \| \| keyboard and mouse \| `pc_prompt_glyphs.gfx`, or `LEONIDA_PC_GLYPHS` \| `tools/pc_prompt_glyphs.py` \| How the... | +| `LEONIDA_RELAUNCHED_FROM` | see the code | | | | `leonida-hle/modules/lifecycle.rs` | | +| `LEONIDA_SECTION_WINDOW` | see the code | | | | `leonida-hle/modules/xmem.rs` | `LEONIDA_SECTION_WINDOW=0`: a view for each write, as before. | +| `LEONIDA_STREAM_NOTICE` | see the code | | | | `leonida-hle/modules/xmem.rs` | `LEONIDA_STREAM_NOTICE=0`: not told; what is then done is `LEONIDA_PAGE_WRITES`' to say (`leonida_gpu::title_memory_written`). | +| `LEONIDA_STREAM_PRIORITY` | see the code | | | | `leonida-hle/modules/xmem.rs` | Called where that thread maps and submits: lifts a thread that is below normal to above it (`LEONIDA_STREAM_PRIORITY=0`: left as the title set it). | +| `LEONIDA_WINDOW_MAX` | see the code | | | | `leonida-hle/modules/lifecycle.rs` | `LEONIDA_WINDOW_MAX=WIDTHxHEIGHT` applies a smaller limit without changing the title's render targets. | +| `LEONIDA_XMA_DUMP` | see the code | | | | `leonida-hle/modules/audio.rs` | `LEONIDA_XMA_DUMP=<dir>`: saves the context words (`<n>-<index>.ctx`) and input buffer 0 (`.xma`) of the first 32 voices enabled, to test the decoder on a title's streams outside the title. | + +## leonida-loader + +| Name | Kind | A/B | L | F | Named in | In the code's words | +|---|---|---|---|---|---|---| +| `LEONIDA_CLZERO_ASK` | see the code | | | | `leonida-loader/console_insn.rs` | `LEONIDA_CLZERO_ASK=1` asks every time, as before. | +| `LEONIDA_NO_WATCHDOG` | see the code | | | | `leonida-loader/hooks.rs` +1 | LEONIDA_RENDER_SCALE / LEONIDA_OWN_UPSCALER / LEONIDA_NO_WATCHDOG title patches. | +| `LEONIDA_OUTPUT_1440` | see the code | | | | `leonida-loader/hooks.rs` | | +| `LEONIDA_PATCH_CLZERO` | see the code | | | | `leonida-loader/console_insn.rs` | `LEONIDA_PATCH_CLZERO=0` emulates each time, as before. | +| `LEONIDA_PATCH_WAITS` | see the code | | | | `leonida-loader/console_insn.rs` | `LEONIDA_PATCH_WAITS=0` emulates each time, as before. | +| `LEONIDA_PROFILE_ONLY` | see the code | | | yes | `leonida-loader/profile.rs` | `LEONIDA_PROFILE_ONLY=<name>[,<name>..]` samples only the threads whose name or start (`module+rva`) holds one of them, which makes the rounds short. | +| `LEONIDA_RENDER_SCALE_MIN` | see the code | | | | `leonida-loader/hooks.rs` +1 | | +| `LEONIDA_SIM_MAX_STEP_MS` | see the code | | | | `leonida-loader/hooks.rs` +1 | The ceiling `LEONIDA_SIM_MAX_STEP_MS` asks for: `Some(None)` for the title's own, `None` if not one of them. | +| `LEONIDA_STACKS` | see the code | | | | `leonida-loader/profile.rs` +1 | `LEONIDA_STACKS=<seconds>[,<seconds>...]` prints each thread's unwound stack as `module+rva` that many seconds after [`dump_stacks_on_schedule`], to find what a title waits on. | + +## leonida-lua + +| Name | Kind | A/B | L | F | Named in | In the code's words | +|---|---|---|---|---|---|---| +| `LEONIDA_MODS` | see the code | | | | `leonida-lua/manifest.rs` | `LEONIDA_MODS`, else `mods` beside the executable or in a folder above it (so a run from `d3d12\target\...` finds the repository's own), else `mods` in the current folder. | + +## leonida-menu + +| Name | Kind | A/B | L | F | Named in | In the code's words | +|---|---|---|---|---|---|---| +| `LEONIDA_MENU_OPEN` | see the code | | | | `leonida-menu/app.rs` +1 | `LEONIDA_MENU_OPEN=1` starts it open, for a test with no keyboard. | +| `LEONIDA_SCREENSHOTS` | see the code | | | | `leonida-menu/knobs.rs` | `LEONIDA_SCREENSHOTS`, else `screenshots` beside the runtime. | + +## leonida-shader + +| Name | Kind | A/B | L | F | Named in | In the code's words | +|---|---|---|---|---|---|---| +| `LEONIDA_CVT_SATURATE` | see the code | | | | `leonida-shader/emit/lower.rs` | `LEONIDA_CVT_SATURATE=0` restores the old lowering. | +| `LEONIDA_DESC_WHY` | see the code | | | | `leonida-shader/emit/lower.rs` | | +| `LEONIDA_DIV_FIXUP_ZERO_FIRST` | see the code | | | | `leonida-shader/emit/lower.rs` | `LEONIDA_DIV_FIXUP_ZERO_FIRST=0` restores the old lowering. | +| `LEONIDA_GROUP_SYNC` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | `LEONIDA_GROUP_SYNC`: - unset or `2`: every barrier waits, as before. - `1`: the title's `s_barrier` waits only in a block every lane runs, in a program no lane can be cut out of at the iteration limit. - `0`: no barrier... | +| `LEONIDA_HDR_CLAMP` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | `LEONIDA_HDR_CLAMP=0`: written as they are, as before). | +| `LEONIDA_LDS_EXACT` | see the code | | | yes | `leonida-shader/emit/lds_exact.rs` | `LEONIDA_LDS_EXACT=0` turns this off. | +| `LEONIDA_LDS_INIT_HOIST` | see the code | | | yes | `leonida-shader/emit/lds_init.rs` | `LEONIDA_LDS_INIT_HOIST=0` turns it off. | +| `LEONIDA_LOOPS_WAVE` | see the code | | | yes | `leonida-shader/emit/lower.rs` +4 | `LEONIDA_LOOPS_WAVE`: - unset or `1`: console wave64 compute programs on a host of 32-lane waves; - `0`: none; - `2`: every compute program. | +| `LEONIDA_LSHL_ADD_SCC` | see the code | | | | `leonida-shader/emit/lower.rs` | `LEONIDA_LSHL_ADD_SCC=0` restores the old lowering. | +| `LEONIDA_MED3_CLAMP` | see the code | | | yes | `leonida-shader/emit/lower.rs` | `LEONIDA_MED3_CLAMP=0`: the general form, as before): the same bits, with fewer instructions (bounds -1 and 2: 20 to 14). | +| `LEONIDA_MESH_COUNTS` | see the code | | | yes | `leonida-shader/emit/lower.rs` +1 | A mesh program's own output counts (`LEONIDA_MESH_COUNTS=1`; off by default). | +| `LEONIDA_MESH_LOOP_EXITS` | see the code | | | yes | `leonida-shader/emit/lower.rs` | `LEONIDA_MESH_LOOP_EXITS`, on unless `0` (then a lane at the limit leaves the program from inside the loop, [`Lower::abort_block`], as before). | +| `LEONIDA_MINMAX_NONZERO` | see the code | | | yes | `leonida-shader/emit/lower.rs` | `LEONIDA_MINMAX_NONZERO=0`: as before). | +| `LEONIDA_NAN_SCRUB_INF` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | `LEONIDA_NAN_SCRUB_INF=0`: 0, as before). | +| `LEONIDA_NAN_SCRUB_STORE_INF` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | `LEONIDA_NAN_SCRUB_STORE_INF=0`: as the colours, held at 65504 with its sign or 0 by [`nan_scrub_holds_infinity`], as before). | +| `LEONIDA_NULL_VIEW_SIZE` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | `LEONIDA_NULL_VIEW_SIZE=0`: the host's zeros less one, as before). | +| `LEONIDA_SCALAR_MINMAX_SCC` | see the code | | | | `leonida-shader/emit/lower.rs` | `LEONIDA_SCALAR_MINMAX_SCC=0` restores the old lowering. | +| `LEONIDA_SHADER_LOOP_LIMIT` | see the code | | | | `leonida-shader/emit/mod.rs` | With the `diagnostics` feature, `LEONIDA_SHADER_LOOP_LIMIT` (decimal or `0x` hex, at least 1) sets it instead. | +| `LEONIDA_SHADER_OPT` | see the code | | | yes | `leonida-shader/emit/bitcode/opt.rs` +2 | `LEONIDA_SHADER_OPT`: - unset: every pass but the wide loads (447). - `0`: none (the module as the lowering made it). - a number (decimal or `0x` hex): those passes; 1 dead code, 2 constants and identities, 4 one instruc... | +| `LEONIDA_SHADER_SOURCE_HASH` | see the code | | | | `leonida-shader/emit/mod.rs` | | +| `LEONIDA_SHADER_SWITCHES` | see the code | | | | `leonida-shader/emit/mesh_counts.rs` +2 | | +| `LEONIDA_WARP` | see the code | | | | `leonida-shader/emit/diff_tests.rs` +1 | Set `LEONIDA_WARP=1` to draw on WARP. | +| `LEONIDA_WAVE_WHY` | see the code | | | yes | `leonida-shader/emit/lds_flags.rs` +2 | `LEONIDA_WAVE_WHY=1`: why a program keeps 64-lane waves (one line per reason) | +| `LEONIDA_WAVE_WIDE_LAST` | see the code | | | yes | `leonida-shader/emit/mod.rs` | `LEONIDA_WAVE_WIDE_LAST=all` takes every group [`widen`] does, `0` none; `LEONIDA_WAVE_WIDE=0` turns the form off everywhere. | + +## scripts and others + +| Name | Kind | A/B | L | F | Named in | In the code's words | +|---|---|---|---|---|---|---| +| `LEONIDA_HAIR_SHADOW_MASKS` | see the code | | | | `scripts/play-nvidia.ps1` | | +| `LEONIDA_REFRESH_NEXT` | see the code | | | | `scripts/play-nvidia.ps1` | | +| `LEONIDA_SKIP_RT_RESOLVE` | see the code | | | | `scripts/play-nvidia.ps1` | | +| `LEONIDA_TITLE_GRAPHICS` | see the code | | | yes | `scripts/play-nvidia.ps1` | | +| `LEONIDA_WATER_TRANSMISSION` | see the code | | | yes | `scripts/play-nvidia.ps1` | | + +## Only in tests + +Read by test code alone, or made up by it: `LEONIDA_A`, `LEONIDA_B`, `LEONIDA_BCPACK_CASES`, `LEONIDA_BCPACK_TABLES`, `LEONIDA_BENCH_FILE`, `LEONIDA_BENCH_HOLES`, `LEONIDA_CONSOLE_DXC`, `LEONIDA_DIFF_ONLY`, `LEONIDA_EXIT_CHILD`, `LEONIDA_HOST_LOCK_CHILD`, `LEONIDA_MENU_PREVIEW`, `LEONIDA_NONE_SUCH`, `LEONIDA_PC_DXC`, `LEONIDA_PLACES_DIR`, `LEONIDA_PLACES_RUN`, `LEONIDA_PROBE`, `LEONIDA_PROBE_STREAMLINE`, `LEONIDA_REF_PS`, `LEONIDA_REF_VS`, `LEONIDA_SAVE_CHILD`, `LEONIDA_SAVE_OP`, `LEONIDA_SAVE_STOP`, `LEONIDA_TEST_D3D_DEBUG`, `LEONIDA_TEST_ROUNDS`, `LEONIDA_TRAP_LOG`, `LEONIDA_XMA_REFERENCE`, `LEONIDA_XMA_STREAMS`. diff --git a/docs/README.md b/docs/README.md index 40e9ad2640..4aca8051d8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -125,6 +125,9 @@ method, scope and caveats. No game data is included. | Document | What it covers | |---|---| +| [measuring_fps.md](measuring_fps.md) | How to measure frame rates of the D3D12 runtime (`d3d12/`): look in the findings first, turn a switch inside one run with `LEONIDA_AB`, separate runs, which log number means what, what to write before reporting a cause. | +| [d3d12/docs/findings.md](../d3d12/docs/findings.md) | What was measured of the D3D12 runtime's frame on several PCs: where a frame goes, switches by turns with their spread, what was not worth it, picture faults and what they were. | +| [d3d12/docs/switches.md](../d3d12/docs/switches.md) | The `LEONIDA_*` variables the D3D12 runtime names, made from its sources (`tools/d3d12_switches.py`): how each is read, whether `LEONIDA_AB` can turn it, the sentence of the code's comment. | | [launcher.md](launcher.md) | The Leonida Launcher: the desktop window with navigation, a PLAY button, status line and pages; Leonida's own design, no game assets. | | [mod-menu.md](mod-menu.md) | The in-game trainer menu drawn by the D3D12 runtime (`d3d12/`): on by default, `LEONIDA_MENU=0` turns it off; single player only, nothing online. | | [lua-modding.md](lua-modding.md) | Lua 5.4 mods in the D3D12 runtime: a folder in `mods\` with the same `mod.json` the mod manager lists, and a script next to it. | diff --git a/docs/measuring_fps.md b/docs/measuring_fps.md new file mode 100644 index 0000000000..e97fe2a9e2 --- /dev/null +++ b/docs/measuring_fps.md @@ -0,0 +1,82 @@ +# Measuring frame rates of the D3D12 runtime + +How to find out whether a change or a switch moves the frame of the Rust D3D12 runtime (`d3d12/`), and how not to fool +yourself. It is about method; the measurements are in [d3d12/docs/findings.md](../d3d12/docs/findings.md) and the list +of switches in [d3d12/docs/switches.md](../d3d12/docs/switches.md). + +## 1. Look first + +Search [findings.md](../d3d12/docs/findings.md) for the switch or the function you have in mind, on a fresh `main`. +Many switches have been measured there, with the card, the scene, the method and the spread. On the night of +2026-11-29 several runs on two PCs went into `LEONIDA_COPYBACK_ELIDE`, whose entry already said "not usable here". + +## 2. Turn the switch inside one run + +`LEONIDA_AB=,[,..]` turns switches on and off every so many seconds while the title runs, so +both sides are measured in one scene, at one cache temperature, beside the same programs +([`ab.rs`](../d3d12/crates/leonida-gpu/src/ab.rs)): + +- It needs a build with `diagnostics` (the one `d3d12/scripts/build-nvidia.ps1` makes) and more than one second a phase. +- Up to eight switches; switch number *n* is on in the phases whose number has bit *n*, so every combination comes round. +- A switch named there no longer goes by its own variable. Only switches the code reads that way follow it; for any + other name the phases are logged and nothing changes, so check the name in [switches.md](../d3d12/docs/switches.md) + or the code before you believe a "no difference". +- Not every switch may be turned in play: `findings.md` has one that ends the title (`LEONIDA_ASYNC_SUBMIT`). +- Each phase ends with a line `A/B phase bits on [...]`: frames, mean, median, p90, draws a frame, the card's + idle and busy time a frame and the submitting thread's work a frame. The first second of a phase is left out. + +Phases of 3.5 to 4 s worked there. The idle camera goes round views of about 24 s with different draw counts, so phases +of 15 s measured the views rather than the switch. Standing, `findings.md` cuts the phases into stretches where the draw count +jumps, leaves out the first phase of a stretch and fits a level for each stretch; walking, it takes the mean of the differences of +neighbouring phases. Give the effect **with its standard error**. The scripts it names for this (`ab_pair.py`, `ab_eff.py`) are not in +the repository. + +That gave about 0.2 to 0.8 ms of spread for a standing run of some minutes and 1 to 2 ms for a walking one. Two separate +runs of one setting differed by 7 ms in one of its tables (75.0 and 82.1 ms). + +## 3. When only separate runs will do + +A change of code, or a switch that cannot be turned in play, needs separate runs: + +- The same save for every start. The title rewrites its autosave, so keep a copy and put it back before each start + (and the player's own back afterwards). +- Alternate (A B B A), in one sitting, with a throwaway run first: one PC's first measured run after a warm-up came out slowest + in both series it was looked for in (2026-11-30; not explained). +- After a translator change, or on a new build, play a while first. Until its pipelines are made, a run measures that. +- The same programs in the background, and nothing heavy beside it: no compiler, no test suite. `findings.md` has one build at 16.2 to 17.3 + and then 12.8 frames a second; what had changed was the programs that start with Windows. +- Check every run for the state you think it was in: it reached the world, it did not stay in the menu, it did not end early. A run + that stayed in the menu shows 60. +- With two runs a side, do not claim a difference smaller than the spread between runs of the same side. + +## 4. Which number means what + +- **Frame time, not only frames a second.** The line `leonida_gpu::host: fps, ms/frame (...)` counts rendered + frames. With frame generation the screen shows more; say which you mean, or measure with `-NoFrameGen`. +- Report the median and a low percentile, and leave the menu and the loading out. +- **A sum over all threads is not a part of the frame.** "All threads", "list calls ... ms", the process's CPU time and + a whole-process profile add up work that runs side by side. They can exceed the frame many times over. +- **A thread that waits because it has nothing to do costs nothing.** The relay line says its thread waits "beside the + submitting thread"; what other threads lost to it is in the line about *settles*. +- Draws "left out on purpose" are not missing pipelines; the line gives both counts. +- The frame stands at the longest of its walls (the card, the submitting thread, the title). Work taken off another one + does not show. Cards and CPUs differ: say the card, driver, CPU, memory, profile, resolution, scene and commit. + +## 5. Where a frame goes + +All in builds with `diagnostics`; each costs something, so do not read frame rates from the same run. + +| Tool | What it answers | +|---|---| +| `LEONIDA_TIMELINE=` (with `LEONIDA_TIMELINE_AT`, `LEONIDA_TIMELINE_FRAMES`) | A trace of a few frames for `chrome://tracing` or Perfetto, and a text summary with **the chain of work and waits each present came out of**: the tool for "what does the frame wait for". | +| `LEONIDA_PROFILE=,,,` (with `LEONIDA_PROFILE_ONLY=`) | Stack samples by thread, waits included, from inside the process. Do not name the title's own threads: `findings.md` has a run that ended that way. | +| `LEONIDA_GPU_TIMING=1` | The commands' time on the card. | + +Windows Performance Recorder works too (it needs an administrator). Wait until it says that the trace was saved before you open the file. + +## 6. Before you report a cause + +1. Write the prediction and what would refute it before the run. +2. Say **MEASURED** (with *n*), **READ IN CODE** or **ASSUMED**. +3. Try to refute it: if this were the cause, what else would have to be true? Is it on the submitting thread's chain? +4. Post numbers only: no logs, captures, shader or pipeline names that are not already in the repository, addresses of the title, or other game data. diff --git a/tests/test_d3d12_switches.py b/tests/test_d3d12_switches.py new file mode 100644 index 0000000000..e1e30c325d --- /dev/null +++ b/tests/test_d3d12_switches.py @@ -0,0 +1,123 @@ +"""tools/d3d12_switches.py: which LEONIDA_* names of the D3D12 runtime it finds and what it says of each. + + python -I tests/test_d3d12_switches.py + +Sources written by hand here; the last test runs on the repository's own. No build, no GPU, no game files. +""" +import contextlib +import io +import os +import re +import sys +import tempfile +import unittest + +ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +sys.path.insert(0, os.path.join(ROOT, "tools")) +import d3d12_switches as ds # noqa: E402 + +GPU = "d3d12/crates/leonida-gpu/src/" +SOURCE = """//! A module. `LEONIDA_FAST=1`: the quick way; off by default. Another sentence. +/// Whether the old way is kept +/// (`LEONIDA_OLD_WAY=0`: not). +fn old() -> bool { crate::toggled!("LEONIDA_OLD_WAY") } +fn fast() -> bool { crate::asked!("LEONIDA_FAST") } +fn slow() -> bool { crate::switch::on("LEONIDA_SLOW") } +fn size() -> u64 { + std::env::var( + "LEONIDA_SIZE_MB").unwrap().parse().unwrap() +} +#[cfg(test)] +mod other; +fn after() { std::env::var_os("LEONIDA_AFTER_OUTLINE"); } +#[cfg(test)] +mod tests { + fn t() { std::env::var("LEONIDA_TEST_CHILD"); } +} +fn last() { std::env::var("LEONIDA_LAST"); } +""" + + +class CollectTest(unittest.TestCase): + def setUp(self): + self.found = ds.collect({GPU + "a.rs": SOURCE}, launcher=" LEONIDA_FAST = '1'\n", findings="x `LEONIDA_SLOW` y") + + def kind(self, name): + return ds.kind(self.found[name]["uses"], name) + + def test_the_kind_is_told_from_how_the_name_is_read(self): + self.assertEqual(self.kind("LEONIDA_OLD_WAY"), "on, `0` turns it off") + self.assertEqual(self.kind("LEONIDA_FAST"), "off unless set and not `0`") + self.assertEqual(self.kind("LEONIDA_SLOW"), "off unless set and not `0`") + self.assertEqual(self.kind("LEONIDA_SIZE_MB"), "see the code") + + def test_only_a_name_the_ab_macros_take_is_marked_for_ab(self): + self.assertTrue(self.found["LEONIDA_OLD_WAY"]["ab"]) + self.assertTrue(self.found["LEONIDA_FAST"]["ab"]) + self.assertFalse(self.found["LEONIDA_SLOW"]["ab"]) + + def test_test_modules_are_told_from_code_after_them_and_from_outline_modules(self): + self.assertTrue(self.found["LEONIDA_TEST_CHILD"]["tests"]) + self.assertFalse(self.found["LEONIDA_AFTER_OUTLINE"]["tests"]) + self.assertFalse(self.found["LEONIDA_LAST"]["tests"]) + + def test_a_test_file_is_all_tests(self): + found = ds.collect({GPU + "x_tests.rs": 'fn f() { std::env::var("LEONIDA_ONLY_HERE"); }'}) + self.assertTrue(found["LEONIDA_ONLY_HERE"]["tests"]) + + def test_the_sentence_that_names_it_is_taken_over_line_ends(self): + self.assertEqual(self.found["LEONIDA_OLD_WAY"]["said"], "Whether the old way is kept (`LEONIDA_OLD_WAY=0`: not).") + self.assertEqual(self.found["LEONIDA_FAST"]["said"], "`LEONIDA_FAST=1`: the quick way; off by default.") + + def test_launcher_and_findings_are_marked(self): + self.assertTrue(self.found["LEONIDA_FAST"]["launcher"]) + self.assertFalse(self.found["LEONIDA_SLOW"]["launcher"]) + self.assertTrue(self.found["LEONIDA_SLOW"]["findings"]) + + def test_a_longer_name_is_not_taken_for_a_shorter_one(self): + self.assertEqual(ds.sentence("`LEONIDA_FAST_N` is a count.", "LEONIDA_FAST"), "") + + def test_a_prefix_is_not_a_name(self): + self.assertEqual(ds.NAME.findall("`LEONIDA_VIPATCH_` and LEONIDA_X"), ["LEONIDA_X"]) + + def test_a_launcher_value_is_never_copied(self): + found = ds.collect({GPU + "a.rs": 'x("LEONIDA_LIST")'}, launcher="LEONIDA_LIST = 'a long value'") + self.assertTrue(found["LEONIDA_LIST"]["launcher"]) + self.assertNotIn("a long value", ds.page(found)) + + +class PageTest(unittest.TestCase): + def test_cells_do_not_break_the_table(self): + found = ds.collect({GPU + "a.rs": '/// `LEONIDA_X=|`: one of two.\nfn f() { v("LEONIDA_X"); }'}) + row = next(line for line in ds.page(found).splitlines() if line.startswith("| `LEONIDA_X`")) + self.assertEqual(len(re.findall(r"(? LONGEST: + # Keep the name in what is left: cut the front when it lies too far in. + at = m.start() - start + front = max(0, at - 60) if at > LONGEST - 80 else 0 + said = ("..." if front else "") + said[front:front + LONGEST].rstrip() + "..." + return said + + +def kind(uses, name): + quoted = f'"{name}"' + text = "\n".join(uses) + if re.search(rf"toggled!\(\s*{quoted}", text): + return "on, `0` turns it off" + if re.search(rf"(asked!|switch::on|switched)\(\s*{quoted}", text): + return "off unless set and not `0`" + return "see the code" + + +def collect(files, launcher="", findings=""): + """{name: {"files", "uses", "said", "ab", "tests", "launcher", "findings"}} over `files` ({path: text}).""" + found = {} + + def entry(name): + return found.setdefault(name, {"files": set(), "uses": [], "said": "", "ab": False, "tests": True, + "launcher": False, "findings": False}) + + for rel in sorted(files): + lines = files[rel].splitlines() + if not rel.endswith(".rs"): + for line in lines: + for name in NAME.findall(line): + e = entry(name) + e["files"].add(rel) + e["tests"] = False + continue + whole, tests = is_test_file(rel), test_lines(lines) + for i, line in enumerate(lines): + comment = COMMENT.match(line) + for name in (NAME.findall(line) if comment else LITERAL.findall(line)): + e = entry(name) + if comment: + e["files"].add(rel) + continue + e["files"].add(rel) + # A call that breaks the line before its argument still says what it is. + e["uses"].append((lines[i - 1].strip() if i else "") + " " + line.strip()) + if not whole and i not in tests: + e["tests"] = False + for name, e in found.items(): + if not e["uses"]: + e["tests"] = False + uses = "\n".join(e["uses"]) + e["ab"] = bool(re.search(rf'(toggled!|asked!|ab::pick|ab::bit)\(\s*"{name}"', uses)) + for rel in sorted(files): + if not rel.endswith(".rs"): + continue + for text in blocks(files[rel].splitlines()): + for name in set(NAME.findall(text)): + said = sentence(text, name) + # A comment where the name is read says more than one that mentions it elsewhere. + here = f'"{name}"' in files[rel] + e = found.get(name) + if e is not None and said and (not e["said"] or (here and not e.get("here"))): + e["said"], e["here"] = said, here + for name in {n for line in launcher.splitlines() for n in ASSIGNED.findall(line)}: + if name in found: + found[name]["launcher"] = True + for name in set(NAME.findall(findings)): + if name in found: + found[name]["findings"] = True + return found + + +def cell(text): + return text.replace("|", "\\|").replace("<", "<").replace(">", ">") + + +def where(files): + """The first file that reads the name, short, and how many others name it.""" + first = min(files, key=lambda f: (not f.endswith(".rs"), f)) + short = re.sub(r"^d3d12/(?:crates|apps)/", "", first).replace("/src/", "/") + short = re.sub(r"^d3d12/", "", short) + more = len(files) - 1 + return f"`{short}`" + (f" +{more}" if more else "") + + +def page(found): + real = {n: e for n, e in found.items() if not e["tests"]} + tests = sorted(n for n, e in found.items() if e["tests"]) + said = sum(1 for e in real.values() if e["said"]) + out = [ + "# The D3D12 runtime's `LEONIDA_*` variables", "", + "Made by `python -I tools/d3d12_switches.py --out d3d12/docs/switches.md` from the sources of `d3d12/`; do not", + "edit it by hand. It says which names exist and what the code's own comments say of them. It is **not** a list of", + "recommended settings and says nothing of what a switch gains: for that read [findings.md](findings.md) first,", + "and [how to measure frame rates](../../docs/measuring_fps.md) before trying one.", "", + f"{len(real)} names; {said} of them are named in a comment of the code, the others have none yet.", "", + "- **Kind**: how the code reads it, where that can be told. \"see the code\" is a number, a path, a list or a", + " switch read some other way; its default is not given here.", + "- **A/B**: `LEONIDA_AB` can turn it while the title runs (builds with `diagnostics`), where the code reads it by", + " name that way. Blank means it was not found so, not that it cannot; the comment may say more.", + "- **L**: the NVIDIA launcher (`d3d12/scripts/play-nvidia.ps1`) has an assignment for it.", + "- **F**: named in [findings.md](findings.md), which is where a measurement would be.", + "- **In the code's words**: the sentence of the comment that names it, cut to one line. Comments go out of date;", + " the code is what counts.", "", + ] + by_top = {} + for n, e in real.items(): + first = min(e["files"], key=lambda f: (not f.endswith(".rs"), f)) + m = re.match(r"d3d12/(?:crates|apps)/([^/]+)/", first) + by_top.setdefault(m.group(1) if m else "scripts and others", []).append(n) + for top in sorted(by_top): + out += [f"## {top}", "", "| Name | Kind | A/B | L | F | Named in | In the code's words |", "|---|---|---|---|---|---|---|"] + for n in sorted(by_top[top]): + e = real[n] + mark = lambda b: "yes" if b else "" + out.append(f"| `{n}` | {kind(e['uses'], n)} | {mark(e['ab'])} | {mark(e['launcher'])} | {mark(e['findings'])} " + f"| {where(e['files'])} | {cell(e['said'])} |") + out.append("") + if tests: + out += ["## Only in tests", "", "Read by test code alone, or made up by it: " + ", ".join(f"`{n}`" for n in tests) + ".", ""] + return "\n".join(out) + + +def difference(found, text): + """(names the sources have and the page lacks, names the page lists that no source has).""" + listed = set(re.findall(r"^\| `(LEONIDA_[A-Z0-9_]+)` \|", text, re.M)) + tests = re.search(r"^Read by test code alone.*$", text, re.M) + if tests: + listed |= set(NAME.findall(tests.group(0))) + return sorted(set(found) - listed), sorted(listed - set(found)) + + +def gather(root): + files = {p: read(root, p) for p in tracked(root, "d3d12") + if p.endswith((".rs", ".ps1", ".cmd")) and "/third_party/" not in p} + launcher = files.get(LAUNCHER, "") + findings = read(root, FINDINGS) if os.path.exists(os.path.join(root, FINDINGS)) else "" + return collect(files, launcher, findings) + + +def main(argv=None): + ap = argparse.ArgumentParser(description="List the LEONIDA_* variables the D3D12 runtime names.") + ap.add_argument("--root", default=ROOT, help="the repository (default: the one this script is in)") + what = ap.add_mutually_exclusive_group(required=True) + what.add_argument("--out", help="write the page here") + what.add_argument("--check", help="compare the names of this page with the sources; exit 1 when they differ") + args = ap.parse_args(argv) + try: + found = gather(args.root) + except (OSError, subprocess.CalledProcessError) as error: + print(f"d3d12_switches.py: cannot list the sources: {error}", file=sys.stderr) + return 2 + if args.check: + try: + with open(args.check, encoding="utf-8") as f: + missing, gone = difference(found, f.read()) + except OSError as error: + print(f"d3d12_switches.py: {error}", file=sys.stderr) + return 2 + for name in missing: + print(f"missing from the page: {name}") + for name in gone: + print(f"no longer in the sources: {name}") + return 1 if missing or gone else 0 + try: + with open(args.out, "w", encoding="utf-8", newline="\n") as f: + f.write(page(found)) + except OSError as error: + print(f"d3d12_switches.py: {error}", file=sys.stderr) + return 2 + print(f"{len(found)} names written to {args.out}") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) From f98f4973ec889721c249f986116fc03e96332c92 Mon Sep 17 00:00:00 2001 From: MoonEyes <14891700+MoonEyes@users.noreply.github.com> Date: Mon, 30 Nov 2026 10:42:33 +0100 Subject: [PATCH 2/6] docs: what the judge of the switches page found The launcher column saw one way of assigning of four, three kinds were wrong, names read by turns through a constant, a function or asked_for! were missing, and test modules with a brace in a raw string were cut short. measuring_fps.md now says how to give LEONIDA_AB to the launcher and what GPU_TIMING and PROFILE need. Co-Authored-By: Claude Opus 5.5 --- d3d12/docs/switches.md | 250 +++++++++++++++++------------------ docs/measuring_fps.md | 34 ++--- tests/test_d3d12_switches.py | 63 ++++++++- tools/d3d12_switches.py | 139 +++++++++++++------ 4 files changed, 299 insertions(+), 187 deletions(-) diff --git a/d3d12/docs/switches.md b/d3d12/docs/switches.md index b2cbe4f294..80611355de 100644 --- a/d3d12/docs/switches.md +++ b/d3d12/docs/switches.md @@ -1,17 +1,18 @@ # The D3D12 runtime's `LEONIDA_*` variables Made by `python -I tools/d3d12_switches.py --out d3d12/docs/switches.md` from the sources of `d3d12/`; do not -edit it by hand. It says which names exist and what the code's own comments say of them. It is **not** a list of -recommended settings and says nothing of what a switch gains: for that read [findings.md](findings.md) first, +edit it by hand. No CI job keeps it up to date: run the command again, or `--check`, when you need it current. +It says which names exist and what the code's own comments say of them. It is **not** a list of recommended +settings and says nothing of what a switch gains: for that read [findings.md](findings.md) first, and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. -641 names; 603 of them are named in a comment of the code, the others have none yet. +630 names; 591 of them are named in a comment of the code, the others have none yet. - **Kind**: how the code reads it, where that can be told. "see the code" is a number, a path, a list or a switch read some other way; its default is not given here. - **A/B**: `LEONIDA_AB` can turn it while the title runs (builds with `diagnostics`), where the code reads it by - name that way. Blank means it was not found so, not that it cannot; the comment may say more. -- **L**: the NVIDIA launcher (`d3d12/scripts/play-nvidia.ps1`) has an assignment for it. + name that way. Blank means it was not found so, not that it cannot. +- **L**: the NVIDIA launcher (`d3d12/scripts/play-nvidia.ps1`) has an assignment for it, perhaps only with some option. - **F**: named in [findings.md](findings.md), which is where a measurement would be. - **In the code's words**: the sentence of the comment that names it, cut to one line. Comments go out of date; the code is what counts. @@ -23,20 +24,20 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_AUDIO_CAPTURE` | see the code | | | | `leonida/main.rs` +1 | `LEONIDA_AUDIO_CAPTURE=<file.wav>` records what the title plays, 48 kHz stereo 16-bit, through process loopback: our own process tree only, never the rest of the host's mix. | | `LEONIDA_CARD_AWAKE` | see the code | yes | yes | yes | `leonida/replay.rs` +4 | Keeps the card's clocks up between submissions (`LEONIDA_CARD_AWAKE=1`; off by default). | | `LEONIDA_CRASH_SAVE` | see the code | | | | `leonida/run.rs` | `LEONIDA_CRASH_SAVE=<rva>:<len>,...` (hex) writes those title ranges to `crash-<rva>.bin` in the cache dir on a crash. | -| `LEONIDA_D3D12_DRED` | off unless set and not `0` | | | yes | `leonida/replay.rs` +7 | Whether device-removed data is on (`LEONIDA_D3D12_DRED`, diagnostics builds). | +| `LEONIDA_D3D12_DRED` | off unless set and not `0` | | yes | yes | `leonida/replay.rs` +7 | Whether device-removed data is on (`LEONIDA_D3D12_DRED`, diagnostics builds). | | `LEONIDA_DUMP_MATCH` | see the code | | | | `leonida/translate.rs` | `LEONIDA_DUMP_MATCH=<dir>;<text>\|<text>...`: the containers whose line holds one of the texts (a name, `#hash`), as the title has them. | | `LEONIDA_DXIL` | see the code | | | | `leonida/main.rs` +1 | The DLL is found at `LEONIDA_DXIL` if set, else the newest Windows SDK's `bin\<version>\x64\dxil.dll`, else wherever `LoadLibrary` finds it. | | `LEONIDA_EMIT_DUMP` | see the code | | | | `leonida/translate.rs` +1 | `LEONIDA_EMIT_DUMP` with `--list`: every emitted shader as a file. | | `LEONIDA_FAIL_DUMP` | see the code | | | | `leonida/translate.rs` | `LEONIDA_FAIL_DUMP=<dir>`: the first 3 containers of each failure reason, as the title has them (`.cdxil`), to work on a translator gap offline | | `LEONIDA_FIND_PLAYER` | see the code | | | | `leonida/player.rs` +2 | Diagnostics only (`LEONIDA_FIND_PLAYER=<start s>,<seconds>`): finds, at run time, where the title keeps the local player's position, and how to reach it from the title's image, so that a teleport can write there (`player... | -| `LEONIDA_FSR_UPSCALER` | see the code | | | yes | `leonida/run.rs` +6 | The title upscales with FidelityFX on Series S, and on the other consoles when the loader makes it (`LEONIDA_FSR_UPSCALER=1`, leonida-loader's hooks.rs). | -| `LEONIDA_GAME_ACTIONS` | see the code | | | | `leonida/game_actions.rs` +7 | Off unless `LEONIDA_GAME_ACTIONS=1`. | +| `LEONIDA_FSR_UPSCALER` | see the code | | yes | yes | `leonida/run.rs` +6 | The title upscales with FidelityFX on Series S, and on the other consoles when the loader makes it (`LEONIDA_FSR_UPSCALER=1`, leonida-loader's hooks.rs). | +| `LEONIDA_GAME_ACTIONS` | see the code | | | | `leonida/game_actions.rs` +7 | Where the title's own code for the trainer menu's game actions is, and the hook that runs them once a frame on the title's own thread (`docs/mod-menu.md`, "Game actions"). Off unless `LEONIDA_GAME_ACTIONS=1`. | | `LEONIDA_GAME_ACTIONS_RUN` | see the code | | | | `leonida/game_actions.rs` | ...by default until it has been seen to work in the title). - `LEONIDA_GAME_ACTIONS_RUN="<s>:<command>;..."` asks for commands that many seconds after the start, for a test without the keyboard: `info`, `cheat <n>`, `wanted... | | `LEONIDA_GAME_ACTIONS_WARP` | see the code | | | | `leonida/game_actions.rs` +1 | ...ts results into the log: the arguments are the asker's). - `LEONIDA_GAME_ACTIONS_WARP=1` lets a teleport write the ped's position on the title's thread: an experiment, the title's own function for moving a ped was not fo... | | `LEONIDA_HOST_MAX_WAVE` | see the code | | | | `leonida/translate.rs` | `LEONIDA_HOST_MAX_WAVE=32`: translate as for a host whose waves have at most 32 lanes (as the runtime does on such a card). | | `LEONIDA_HOST_RDNA` | see the code | | | | `leonida/translate.rs` | `LEONIDA_HOST_RDNA=1`: as for an AMD RDNA card (`LEONIDA_RDNA_FLOAT`). | | `LEONIDA_HOST_WAVE` | see the code | | | yes | `leonida/main.rs` | Set `LEONIDA_HOST_WAVE` and `LEONIDA_VIEW_LIMIT` to what the run's log says of the host. | -| `LEONIDA_INDIRECT_BATCH` | see the code | | yes | yes | `leonida/replay.rs` +9 | `LEONIDA_INDIRECT_BATCH=0`: each on its own, or in windows ([`windows`])). | +| `LEONIDA_INDIRECT_BATCH` | see the code | | yes | yes | `leonida/replay.rs` +9 | Whether indirect executions of one record are clamped in batches (`crate::indirect::batch`; `LEONIDA_INDIRECT_BATCH=0`: each on its own, or in windows ([`windows`])). | | `LEONIDA_KBM_SPEED` | see the code | | | | `leonida/player_context.rs` | `LEONIDA_PLAYER_VEHICLE_AT=off` leaves it unused. - `LEONIDA_KBM_SPEED=1`: how fast the ped moves ([`SpeedRule`]). | | `LEONIDA_KEYS_FILE` | see the code | | | | `leonida/player_find.rs` +2 | Then, for `<seconds>`, it reads every candidate's position every `LEONIDA_PLAYER_INTERVAL_MS` (250) together with the keys held at that moment (the file `LEONIDA_KEYS_FILE` names). | | `LEONIDA_LUA` | see the code | | | | `leonida/run.rs` +2 | `LEONIDA_LUA=0` turns it all off: no thread, and a present pays one atomic load in [`tick`]. | @@ -46,11 +47,11 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_NATIVE_MIN_RUN` | see the code | | | | `leonida/native_scan.rs` | Tuning, all optional: - `LEONIDA_NATIVE_MIN_RUN` (default 64): fewest array elements in a run. - `LEONIDA_NATIVE_MIN_DISTINCT` (default 200): fewest distinct handlers for a run to be listed and to enter the union. - `LEO... | | `LEONIDA_NATIVE_SCAN` | see the code | | | | `leonida/native_scan.rs` +1 | Diagnostics only (`LEONIDA_NATIVE_SCAN`): looks, at run time, for the tables the title's script engine calls its commands through. | | `LEONIDA_NATIVE_U32` | see the code | | | | `leonida/native_scan.rs` | ...ction start, or a 16-aligned byte after `int3` padding). - `LEONIDA_NATIVE_U32=1`: also looks for arrays of 32-bit offsets that are handler addresses relative to some base `B` (see `OffsetArray`).... | -| `LEONIDA_OWN_UPSCALER` | see the code | | | | `leonida/run.rs` +4 | LEONIDA_RENDER_SCALE / LEONIDA_OWN_UPSCALER / LEONIDA_NO_WATCHDOG title patches. | +| `LEONIDA_OWN_UPSCALER` | see the code | | yes | | `leonida/run.rs` +4 | LOCAL (leonida-perf, via our wt5): LEONIDA_RENDER_SCALE / LEONIDA_OWN_UPSCALER / LEONIDA_NO_WATCHDOG title patches. | | `LEONIDA_PAIRS` | see the code | | | | `leonida/translate.rs` | Shaders named in `LEONIDA_PAIRS` (`vs+ps,...`, label substrings), kept to build those pipelines after the walk. | | `LEONIDA_PED_DUMP` | see the code | | | | `leonida/player_context.rs` | `LEONIDA_PED_DUMP=<folder>` (outside the repository) is for measuring: F8 in the game's window, or a file named `dump` in that folder (its text is the dump's label; it is removed as it is seen), writes the first 0x4000 b... | | `LEONIDA_PED_VEHICLE_AT` | see the code | | | | `leonida/player_context.rs` | What says "in a vehicle", the first of these that there is: - `LEONIDA_PED_VEHICLE_AT=0x<offset>`: a field of the player's ped that points at its vehicle and is null on foot (for a measured offset; none is known). - `LEO... | -| `LEONIDA_PIPELINE_BOOK` | see the code | | | | `leonida/main.rs` +2 | Every pipeline the title has ever created, kept on disk (`LEONIDA_PIPELINE_BOOK=1`), and their host pipelines made ahead of a run (`leonida warm`), so that the driver's own cache on disk has them before a draw asks for o... | +| `LEONIDA_PIPELINE_BOOK` | see the code | | yes | | `leonida/main.rs` +2 | Every pipeline the title has ever created, kept on disk (`LEONIDA_PIPELINE_BOOK=1`), and their host pipelines made ahead of a run (`leonida warm`), so that the driver's own cache on disk has them before a draw asks for o... | | `LEONIDA_PLAYER_ALIGN` | see the code | | | | `leonida/player_find.rs` | `LEONIDA_PLAYER_ALIGN` (4; 16 is faster), `LEONIDA_PLAYER_MAX_CANDIDATES` (6000000), `LEONIDA_PLAYER_MAX_TRACKS` (2000000), `LEONIDA_PLAYER_TOP` (100), `LEONIDA_PLAYER_GROUPS` (6), `LEONIDA_PLAYER_POINTERS=0` (no pointer... | | `LEONIDA_PLAYER_F64` | see the code | | | | `leonida/player_find.rs` | ...g\|plain\|any\|off`) and triples of doubles in the map (`D3`, `LEONIDA_PLAYER_F64=0` to skip).... | | `LEONIDA_PLAYER_FILTER` | see the code | | | | `leonida/player_find.rs` | `LEONIDA_PLAYER_FILTER=loose` turns the strict filters off (strict: a 4x4's w column exactly 0 and corner 1, a position that is not a whole number of metres on every axis, axes that are not exactly the world's); `summary... | @@ -64,7 +65,6 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_PLAYER_PATHS` | see the code | | | | `leonida/player.rs` | ...tle's image to them (`%TEMP%\leonida-player\paths.txt`, or `LEONIDA_PLAYER_PATHS=<file>`); this reads that file and follows the paths at run time.... | | `LEONIDA_PLAYER_POINTERS` | see the code | | | | `leonida/player_find.rs` | ..., `LEONIDA_PLAYER_TOP` (100), `LEONIDA_PLAYER_GROUPS` (6), `LEONIDA_PLAYER_POINTERS=0` (no pointer search).... | | `LEONIDA_PLAYER_PROBE` | see the code | | | | `leonida/player_find.rs` | `LEONIDA_PLAYER_PROBE=<s>` starts it that many seconds after the title started, `LEONIDA_PLAYER_PROBE_MAX` (600) bounds the tries. | -| `LEONIDA_PLAYER_PROBE_MAX` | see the code | | | | `leonida/player_find.rs` | `LEONIDA_PLAYER_PROBE=<s>` starts it that many seconds after the title started, `LEONIDA_PLAYER_PROBE_MAX` (600) bounds the tries. | | `LEONIDA_PLAYER_PROBE_SECONDS` | see the code | | | | `leonida/player_find.rs` | | | `LEONIDA_PLAYER_PRUNE_STABLE` | see the code | | | | `leonida/player_find.rs` | A candidate that never moves once movement keys have been held for `LEONIDA_PLAYER_PRUNE_STABLE` (6) samples, or that jumps more than 25 m/s, is dropped. | | `LEONIDA_PLAYER_THREADS` | see the code | | | | `leonida/player_find.rs` | The scan runs on `LEONIDA_PLAYER_THREADS` threads (default 8 at most). | @@ -72,24 +72,23 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_PLAYER_VEC_W` | see the code | | | | `leonida/player_find.rs` | ... lie in the map and whose w is not a float in range (`V4`, `LEONIDA_PLAYER_VEC_W=flag\|plain\|any\|off`) and triples of doubles in the map (`D3`, `LEONIDA_PLAYER_F64=0` to skip).... | | `LEONIDA_PLAYER_VEHICLE_AT` | see the code | | | | `leonida/player_context.rs` | ... is null on foot (for a measured offset; none is known). - `LEONIDA_PLAYER_VEHICLE_AT=0x<offset in the image>`: a global of the title that holds the player's vehicle and is null on foot.... | | `LEONIDA_POKE` | see the code | | | | `leonida/run.rs` | `LEONIDA_POKE=<rva>:<byte>,...` (hex) writes the byte at each title+rva twice a second. | -| `LEONIDA_PORT_DESCRIPTORS` | see the code | | yes | yes | `leonida/run.rs` +4 | ...e, and the per-frame look at every changed heap page goes (`LEONIDA_PORT_DESCRIPTORS=1`, off by default; read in [`on`]).... | +| `LEONIDA_PORT_DESCRIPTORS` | see the code | yes | yes | yes | `leonida/run.rs` +4 | ...e, and the per-frame look at every changed heap page goes (`LEONIDA_PORT_DESCRIPTORS=1`, off by default; read in [`on`]).... | | `LEONIDA_RDNA_FLOAT` | see the code | | | yes | `leonida/translate.rs` +1 | `LEONIDA_RDNA_FLOAT`: a set of [`rdna`]'s bits (decimal or `0x` hex); all of them when it is unset, `0` none. | | `LEONIDA_RECORD` | see the code | | | | `leonida/replay.rs` +2 | On with `LEONIDA_RECORD=<folder>` only; without it nothing is hooked. | -| `LEONIDA_RELAY` | see the code | | | | `leonida/leonida.rs` +8 | The relay's first stage (`LEONIDA_RELAY=1`; off by default; it turns [`late`] on at stage 3 unless `LEONIDA_LATE_WAIT` says another stage, and is off with it, in the timing run and with kept snapshots). | -| `LEONIDA_RENDER_SCALE` | see the code | | | | `leonida/leonida.rs` +5 | The scale `LEONIDA_RENDER_SCALE` asks for, if valid. | +| `LEONIDA_RELAY` | see the code | | yes | | `leonida/leonida.rs` +8 | The relay's first stage (`LEONIDA_RELAY=1`; off by default; it turns [`late`] on at stage 3 unless `LEONIDA_LATE_WAIT` says another stage, and is off with it, in the timing run and with kept snapshots). | +| `LEONIDA_RENDER_SCALE` | see the code | | yes | | `leonida/leonida.rs` +5 | The scale `LEONIDA_RENDER_SCALE` asks for, if valid. | | `LEONIDA_SHADER_CENSUS` | see the code | | | yes | `leonida/translate.rs` +2 | `LEONIDA_SHADER_CENSUS=<file>`: one line per emitted program, appended: its label, the console program's instructions by encoding class (a static count of the whole program, not of one thread's path), and the host module... | | `LEONIDA_SKIP_CPU_CHECK` | see the code | | | | `leonida/run.rs` | | | `LEONIDA_TELEPORT` | see the code | | | | `leonida/player.rs` +1 | Nothing leaves the machine; nothing of the title is stored here. - `LEONIDA_TELEPORT=<delay s>,<x>,<y>,<z>[,<hold ms>]` teleports once, that many seconds after start (the menu's Teleport page and `leonida.teleport` do th... | | `LEONIDA_TELEPORT_LIFT` | see the code | | | | `leonida/player.rs` | ...port page and `leonida.teleport` do the same on demand). - `LEONIDA_TELEPORT_LIFT=<metres>` is added to the target's z (a few metres above the ground, so a position slightly under it does not trap the player). - `LEONIDA... | | `LEONIDA_TRANSLATE_ONLY` | see the code | | | | `leonida/translate.rs` | `LEONIDA_TRANSLATE_ONLY=<hash prefix>,...` translates those containers alone. | -| `LEONIDA_UPSCALE` | see the code | | | | `leonida/run.rs` +6 | `LEONIDA_UPSCALE=stretch\|dlss`: the upscale dispatch is ours (`leonida_hle::modules::ffx`: DLSS, or a plain stretch) instead of the title's own FidelityFX passes, which are slow translated on 32-lane hosts; the rest of t... | +| `LEONIDA_UPSCALE` | see the code | | yes | | `leonida/run.rs` +6 | `LEONIDA_UPSCALE=stretch\|dlss`: the upscale dispatch is ours (`leonida_hle::modules::ffx`: DLSS, or a plain stretch) instead of the title's own FidelityFX passes, which are slow translated on 32-lane hosts; the rest of t... | | `LEONIDA_VICE_CITY` | see the code | | | | `leonida/player.rs` | ... a position slightly under it does not trap the player). - `LEONIDA_VICE_CITY=<x>,<y>,<z>` (or the file `vice.txt` beside the paths) is the place the menu's "To Vice City" item goes to.... | | `LEONIDA_VIEW_LIMIT` | see the code | | | | `leonida/main.rs` | Set `LEONIDA_HOST_WAVE` and `LEONIDA_VIEW_LIMIT` to what the run's log says of the host. | | `LEONIDA_WARM_DONE_ALL` | see the code | | | | `leonida/warm.rs` | `LEONIDA_WARM_DONE_ALL=1`, as before; unset or `0` (the default): only those that have one are done. | | `LEONIDA_WARM_SECONDS` | see the code | | | | `leonida/translate.rs` | `LEONIDA_WARM_SECONDS=<n>`: stop taking new shaders after n seconds (what is done stays in the cache; the next warm-up goes on from there). | | `LEONIDA_WATCH` | see the code | | | | `leonida/run.rs` | `LEONIDA_WATCH=<rva>,...` (hex) logs the u32 at each title+rva whenever it changes, polled every 5 ms (an engine's state, say). | | `LEONIDA_WINDOWS_BUILD` | see the code | | | | `leonida/agility.rs` | `LEONIDA_WINDOWS_BUILD` stands in for it (to try Windows 10's path). | -| `LEONIDA_X` | see the code | | | | `leonida/leonida.rs` +1 | The `LEONIDA_` settings to set for the environment `vars`: one per `VICTORY_X` whose `LEONIDA_X` is not set. | ## leonida-core @@ -107,8 +106,8 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | Name | Kind | A/B | L | F | Named in | In the code's words | |---|---|---|---|---|---|---| | `LEONIDA_AB` | see the code | | | yes | `leonida-gpu/ab.rs` +34 | `LEONIDA_AB=<seconds>,<switch>[,<switch>..]`: every so many seconds, at a present, the next phase begins; switch number n is on in the phases whose number has bit n, so that all combinations come one after another, again... | -| `LEONIDA_ACTIVATE_RAYS` | see the code | | | | `leonida-gpu/pipeline/make.rs` +1 | | -| `LEONIDA_ADAPTER` | see the code | | | | `leonida-gpu/host.rs` +3 | LOCAL: the card `LEONIDA_ADAPTER` names, for a PC with more than one. | +| `LEONIDA_ACTIVATE_RAYS` | see the code | | yes | | `leonida-gpu/pipeline/make.rs` +1 | | +| `LEONIDA_ADAPTER` | see the code | | yes | | `leonida-gpu/host.rs` +3 | LOCAL: the card `LEONIDA_ADAPTER` names, for a PC with more than one. | | `LEONIDA_AHEAD_INDEX` | on, `0` turns it off | yes | | | `leonida-gpu/watch.rs` | Whether the page ranges asked ahead ([`Journal::ahead`]) are kept in order, so that the one that holds a range is found in a few steps (`LEONIDA_AHEAD_INDEX=0`: a list looked through from its start, as before). | | `LEONIDA_AHEAD_SPLIT` | off unless set and not `0` | yes | yes | yes | `leonida-gpu/draw.rs` +1 | `LEONIDA_AHEAD_SPLIT=1`: the list ahead of a frame is recorded as two lists by two threads at once, the buffer views' pass and the textures' pass (sent in that order), instead of one after the other into one list. | | `LEONIDA_ALIAS_CAST` | on, `0` turns it off | yes | | yes | `leonida-gpu/descriptor/host.rs` +2 | ..., with no copy on the card and no host texture of its own (`LEONIDA_ALIAS_CAST=0`: copied as before; `LEONIDA_AB` can name it).... | @@ -119,48 +118,42 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_ALIAS_QUICK` | off unless set and not `0` | yes | | yes | `leonida-gpu/resource.rs` | Off unless `LEONIDA_ALIAS_QUICK=1`; by turns under A/B. | | `LEONIDA_ALLOCATOR_TRIM` | see the code | | | yes | `leonida-gpu/host.rs` +1 | Whether host command allocators are taken anew now and then (`LEONIDA_ALLOCATOR_TRIM=1`; off by default), and after how many seconds (`LEONIDA_ALLOCATOR_TRIM_S`, 30, 5 to 3600). | | `LEONIDA_ALLOCATOR_TRIM_S` | see the code | | | | `leonida-gpu/host.rs` | Whether host command allocators are taken anew now and then (`LEONIDA_ALLOCATOR_TRIM=1`; off by default), and after how many seconds (`LEONIDA_ALLOCATOR_TRIM_S`, 30, 5 to 3600). | -| `LEONIDA_AMBIENT` | see the code | | | | `leonida-gpu/ambient.rs` +3 | `LEONIDA_AMBIENT`: - unset or `0`/`off`: the title's own output. - a number: that share of the estimate (1: all of it). - `constant:<level>`: the constant, as beloooo's fork has it. | +| `LEONIDA_AMBIENT` | see the code | | yes | | `leonida-gpu/ambient.rs` +3 | `LEONIDA_AMBIENT`: - unset or `0`/`off`: the title's own output. - a number: that share of the estimate (1: all of it). - `constant:<level>`: the constant, as beloooo's fork has it. | | `LEONIDA_AMBIENT_AIR` | see the code | | yes | | `leonida-gpu/ambient.rs` +2 | `LEONIDA_AMBIENT_AIR` bounds what the air scatters by a multiple of the light around. | | `LEONIDA_AMBIENT_ALPHA` | see the code | yes | yes | | `leonida-gpu/ambient.rs` +1 | The most light transparent surfaces and particles get from around them, as a multiple of the light around (`LEONIDA_AMBIENT_ALPHA=<multiple>`; unset or 0: what the title has). | | `LEONIDA_AMBIENT_FLOOR` | see the code | yes | | | `leonida-gpu/ambient.rs` | The least diffuse light the estimate gives (`LEONIDA_AMBIENT_FLOOR=<level>`, with `LEONIDA_AMBIENT` a number; unset or 0: no floor), a warm fill shaded in creases as the constant stand-in is. | | `LEONIDA_AMBIENT_MAGENTA` | on, `0` turns it off | yes | | | `leonida-gpu/ambient.rs` | | -| `LEONIDA_AMBIENT_MOST` | see the code | | | | `leonida-gpu/ambient.rs` +1 | Fresh seconds (default 0: none): for that long after such a jump the light the title's own resolve left is bounded by the estimate, not `LEONIDA_AMBIENT_MOST` times it. | +| `LEONIDA_AMBIENT_MOST` | see the code | | yes | | `leonida-gpu/ambient.rs` +1 | Fresh seconds (default 0: none): for that long after such a jump the light the title's own resolve left is bounded by the estimate, not `LEONIDA_AMBIENT_MOST` times it. | | `LEONIDA_AMBIENT_ON` | on, `0` turns it off | yes | | | `leonida-gpu/ambient.rs` | `LEONIDA_AB=<s>,LEONIDA_AMBIENT_ON` measures what the passes cost on the card in one run (off: the title's shading as it is with the rays off); unset, as `LEONIDA_AMBIENT` says. | | `LEONIDA_AMBIENT_SETTLE` | see the code | yes | | | `leonida-gpu/ambient.rs` | How the slow mean of the light around follows the frames (`LEONIDA_AMBIENT_SETTLE=<time constant in ms>[,<jump factor>[,<fresh seconds>]]`, or `LEONIDA_AMBIENT_SETTLE=1`: 250,3; unset or 0: 0.04 of the way a frame, as be... | | `LEONIDA_AMBIENT_SHADE` | see the code | | | | `leonida-gpu/ambient.rs` | `LEONIDA_AMBIENT_SHADE=<strength>,<radius in metres>` sets the creases. | | `LEONIDA_AMBIENT_TRUE_DEPTH` | see the code | | | | `leonida-gpu/ambient.rs` +1 | Whether the resolve's depth is looked for at [`TRUE_DEPTH`] first (`LEONIDA_AMBIENT_TRUE_DEPTH=1`; off by default: [`DEPTH`] alone, as before). | | `LEONIDA_ASK_EARLY` | see the code | | | | `leonida-gpu/watch.rs` | Whether a thread asks, between a submission's askings, about the memory they found written (`LEONIDA_ASK_EARLY=<ms>` between its rounds; off unless given: in run cpu-2 the submissions' own askings were none the cheaper f... | -| `LEONIDA_ASK_GAP_KB` | see the code | yes | | | `leonida-gpu/watch.rs` | `LEONIDA_ASK_GAP_KB=<KiB>`, 8192 by default. | +| `LEONIDA_ASK_GAP_KB` | see the code | yes | | | `leonida-gpu/watch.rs` | ...ritten pages costs 30-70 microseconds whatever the range). `LEONIDA_ASK_GAP_KB=<KiB>`, 8192 by default.... | | `LEONIDA_ASK_GAP_KB_AB` | see the code | | | yes | `leonida-gpu/watch.rs` | Named in `LEONIDA_AB`, the gap asked for against `LEONIDA_ASK_GAP_KB_AB` (256 when not set). | | `LEONIDA_ASK_ONCE` | see the code | | | | `leonida-gpu/host.rs` +1 | Whether a submission asks the kernel once, before its first refresh, about every range its lists refresh (`LEONIDA_ASK_ONCE=1`; off by default). | | `LEONIDA_ASK_RANGES` | on, `0` turns it off | yes | | | `leonida-gpu/watch.rs` | Whether an asking for a submission holds the page ranges it asks the kernel about and no others (`LEONIDA_ASK_RANGES=0`: all of memory, as before). [`ask_ahead`] and [`ask_rest`] held everything ([`Asking::hold_all`]) wh... | -| `LEONIDA_ASPECT` | see the code | | | | `leonida-gpu/aspect.rs` +4 | Two settings, the ones `docs/ultrawide.md` gives the Vulkan runtime: - `LEONIDA_ASPECT=21:9\|32:9\|16:9\|W:H\|<decimal>\|auto`: the shape the title's window is made in (`auto`: the primary monitor's). | +| `LEONIDA_ASPECT` | see the code | | yes | | `leonida-gpu/aspect.rs` +4 | Two settings, the ones `docs/ultrawide.md` gives the Vulkan runtime: - `LEONIDA_ASPECT=21:9\|32:9\|16:9\|W:H\|<decimal>\|auto`: the shape the title's window is made in (`auto`: the primary monitor's). | | `LEONIDA_ASYNC_SUBMIT` | see the code | yes | | yes | `leonida-gpu/queue.rs` +1 | Submissions prepared and sent by a thread of ours, in order, instead of by the thread of the title that submits them (`LEONIDA_ASYNC_SUBMIT=1`). | | `LEONIDA_BACK_RENEW` | on, `0` turns it off | yes | | | `leonida-gpu/host.rs` +1 | `LEONIDA_BACK_RENEW=0`: a stale one is kept, as before. | -| `LEONIDA_BAKE_AHEAD` | see the code | | | yes | `leonida-gpu/draw.rs` | ...e air, waiting for the uploads and showing the slots then (`LEONIDA_BAKE_AHEAD=1`, or by turns with `LEONIDA_AB`; off by default).... | +| `LEONIDA_BAKE_AHEAD` | see the code | yes | | yes | `leonida-gpu/draw.rs` | ...e air, waiting for the uploads and showing the slots then (`LEONIDA_BAKE_AHEAD=1`, or by turns with `LEONIDA_AB`; off by default).... | | `LEONIDA_BAKE_EXACT` | see the code | | | | `leonida-gpu/draw.rs` | Whether a draw of the title's bake finds the textures it picks by index as title memory has them at that moment (`LEONIDA_BAKE_EXACT=0`: as the pass leaves them, as before). | | `LEONIDA_BAKE_TEXTURES_MS` | see the code | | | | `leonida-gpu/draw.rs` | ...ay take just before a draw of the title's decoration bake (`LEONIDA_BAKE_TEXTURES_MS`, 1500; 0: nothing special).... | | `LEONIDA_BARRIER_MERGE` | off unless set and not `0` | yes | | yes | `leonida-gpu/draw.rs` +1 | ... no command since that can write through unordered access (`LEONIDA_BARRIER_MERGE=1`; off by default; `LEONIDA_AB` can name it).... | | `LEONIDA_BARRIER_TEST` | see the code | | | | `leonida-gpu/copystat.rs` +2 | Whether an experiment on barriers is on (`LEONIDA_BARRIER_TEST`): bit 0 for `groups` (the title's barrier groups record no wait for earlier shader writes), bit 1 for `indirect` (the pass that bounds an indirect command r... | | `LEONIDA_BARRIER_WAITS` | on, `0` turns it off | yes | | | `leonida-gpu/copystat.rs` | `LEONIDA_AB=<s>,LEONIDA_BARRIER_WAITS` (off: both kinds of waits left out, as `both`). | -| `LEONIDA_BATCH_DESCRIPTORS` | see the code | | | yes | `leonida-gpu/descriptor/host.rs` +2 | ... table instead of one `CopyDescriptorsSimple` call a slot (`LEONIDA_BATCH_DESCRIPTORS=1`, or by turns with `LEONIDA_AB`; off by default).... | +| `LEONIDA_BATCH_DESCRIPTORS` | see the code | yes | | yes | `leonida-gpu/descriptor/host.rs` +2 | ... table instead of one `CopyDescriptorsSimple` call a slot (`LEONIDA_BATCH_DESCRIPTORS=1`, or by turns with `LEONIDA_AB`; off by default).... | | `LEONIDA_BATCH_KEPT` | on, `0` turns it off | yes | | yes | `leonida-gpu/host.rs` | (`LEONIDA_BATCH_KEPT`: read once, so that the whole submission goes one way while `LEONIDA_AB` flips it.) | | `LEONIDA_BATCH_SCRATCH_POOL` | on, `0` turns it off | yes | | yes | `leonida-gpu/host.rs` | Whether the scratch buffers of the batched clamps ([`HostList::batch_place`]) are shared by the lists (`LEONIDA_BATCH_SCRATCH_POOL=0`: a list keeps every one it ever took for as long as it lives, as before; `LEONIDA_AB`... | | `LEONIDA_BATCH_TEXTURE_DISPATCHES` | on, `0` turns it off | yes | | | `leonida-gpu/draw.rs` | `LEONIDA_BATCH_TEXTURE_DISPATCHES=0`: every dispatch ends the batch, as before (an A/B switch, `LEONIDA_AB`). | | `LEONIDA_BATCH_WHY` | off unless set and not `0` | | | yes | `leonida-gpu/draw.rs` +1 | `LEONIDA_BATCH_WHY=1` counts what ends indirect batches and by which programs' declared ranges ([`batch_why_line`]). | -| `LEONIDA_BENCH_CS` | see the code | | | | `leonida-gpu/indirect.rs` | `LEONIDA_BENCH_CS=<file>` times another source of the shader. | -| `LEONIDA_BENCH_N` | see the code | | | | `leonida-gpu/indirect.rs` | `LEONIDA_BENCH_N` runs of each, 3). | -| `LEONIDA_BENCH_S` | see the code | | | | `leonida-gpu/indirect.rs` | Whether the card can read a texture's descriptor half written (ignored: a measurement of the card, `LEONIDA_BENCH_S` seconds a way, 5). | -| `LEONIDA_BENCH_THREADS` | see the code | | | | `leonida-gpu/indirect.rs` | Threads (`LEONIDA_BENCH_THREADS`, 4) make blocks of 64 MiB, a texture in each and its view, and copies the view into a slot; long dispatches that read all the slots are always on the card. | -| `LEONIDA_BENCH_WARP` | see the code | | | | `leonida-gpu/indirect.rs` | | | `LEONIDA_BIND_CACHE` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_BIND_CACHE=0` sets them every time. | -| `LEONIDA_BLOCK_WAY` | see the code | | | | `leonida-gpu/indirect.rs` | | -| `LEONIDA_BOOK` | see the code | | | | `leonida-gpu/book.rs` | `LEONIDA_BOOK=0` keeps none. | -| `LEONIDA_BURY_LAG` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_BURY_LAG=0`: not. | +| `LEONIDA_BOOK` | see the code | | | | `leonida-gpu/book.rs` | The book is kept with device-removed data on (`LEONIDA_D3D12_DRED`) or the check; `LEONIDA_BOOK=0` keeps none. | +| `LEONIDA_BURY_LAG` | see the code | | | | `leonida-gpu/host.rs` | Objects let go while nothing runs wait as well: lists recorded and not yet sent may name them. `LEONIDA_BURY_LAG=0`: not. | | `LEONIDA_BVH_BOUNDS` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | Whether the structure builder's accesses through its root views stay near them, and a size in a structure's header that cannot be one counts as none (`LEONIDA_BVH_BOUNDS=0`: neither). | -| `LEONIDA_BVH_BUILDER` | see the code | | | | `leonida-gpu/fg.rs` +6 | ... for the rest of the run at first. shortcut: and only with `LEONIDA_BVH_BUILDER=1`, until a run has shown the whole builder and the host side of title memory by address (`memory.rs`) working on a card; nothing reads the... | +| `LEONIDA_BVH_BUILDER` | see the code | | yes | | `leonida-gpu/fg.rs` +6 | ... for the rest of the run at first. shortcut: and only with `LEONIDA_BVH_BUILDER=1`, until a run has shown the whole builder and the host side of title memory by address (`memory.rs`) working on a card; nothing reads the... | | `LEONIDA_BVH_FENCES` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | Whether buffer atomics of the ray-tracing structure builder stand between two fences (`LEONIDA_BVH_FENCES=0`: they do not). | -| `LEONIDA_BVH_MISS` | see the code | | | | `leonida-gpu/pipeline/make.rs` +2 | With every ray a miss (`LEONIDA_BVH_MISS=1`) the tiles they trace come out lit: in the fork, stair-stepped sun patches on walls and clothes and hair glowing in the sun. | +| `LEONIDA_BVH_MISS` | see the code | | yes | | `leonida-gpu/pipeline/make.rs` +2 | With every ray a miss (`LEONIDA_BVH_MISS=1`) the tiles they trace come out lit: in the fork, stair-stepped sun patches on walls and clothes and hair glowing in the sun. | | `LEONIDA_BVH_QUARANTINE` | see the code | | | | `leonida-gpu/pipeline.rs` | `LEONIDA_BVH_QUARANTINE=1`: what the structure builder's stages store stays in the host's copies and is not copied back into title memory. | | `LEONIDA_BVH_SIZES_WAIT` | see the code | | | | `leonida-gpu/memory.rs` | Whether a submission that asks for the sizes of structures is waited for, and landed, before the title goes on (`LEONIDA_BVH_SIZES_WAIT=1`; off). | | `LEONIDA_BVH_TRACE` | see the code | | | | `leonida-gpu/memory.rs` | `LEONIDA_BVH_TRACE=1`: the sizes the builder is asked for (its program of one thread that stores a structure's compacted size) and when title memory has them, and the copies to a place of that size. | @@ -172,35 +165,35 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_CARD_ACCOUNTING` | see the code | | | | `leonida-gpu/draw.rs` +1 | Off unless `LEONIDA_CARD_ACCOUNTING=1`; then at the first pass that finds the card without room, and every five seconds after it. | | `LEONIDA_CARD_ALL` | see the code | | | | `leonida-gpu/host/place.rs` +2 | One in the card's memory, one in the PC's (one side without `LEONIDA_CARD_ALL`). | | `LEONIDA_CARD_BUFFERS` | see the code | | | | `leonida-gpu/shadow.rs` | `LEONIDA_CARD_BUFFERS=0` keeps every copy in the PC's memory, as before. | -| `LEONIDA_CARD_BUFFERS_MB` | see the code | | | | `leonida-gpu/host/menu.rs` +2 | Resolve `(min_bytes, max_bytes)` from the adapter's local VRAM budget and optional explicit MiB overrides from `LEONIDA_CARD_BUFFERS_MIN_MB` / `LEONIDA_CARD_BUFFERS_MB`. | -| `LEONIDA_CARD_BUFFERS_MIN_KB` | see the code | | | yes | `leonida-gpu/shadow.rs` +1 | With the title's buffers of a megabyte and more on the card that is a hundred copies; with the small ones too (`LEONIDA_CARD_BUFFERS_MIN_KB=64`) it was 3,540 copies times 29 submissions, 2.4 ms a frame of the submitting... | +| `LEONIDA_CARD_BUFFERS_MB` | see the code | | yes | | `leonida-gpu/host/menu.rs` +2 | Resolve `(min_bytes, max_bytes)` from the adapter's local VRAM budget and optional explicit MiB overrides from `LEONIDA_CARD_BUFFERS_MIN_MB` / `LEONIDA_CARD_BUFFERS_MB`. | +| `LEONIDA_CARD_BUFFERS_MIN_KB` | see the code | | yes | yes | `leonida-gpu/shadow.rs` +1 | With the title's buffers of a megabyte and more on the card that is a hundred copies; with the small ones too (`LEONIDA_CARD_BUFFERS_MIN_KB=64`) it was 3,540 copies times 29 submissions, 2.4 ms a frame of the submitting... | | `LEONIDA_CARD_BUFFERS_MIN_MB` | see the code | | yes | | `leonida-gpu/shadow.rs` +1 | Resolve `(min_bytes, max_bytes)` from the adapter's local VRAM budget and optional explicit MiB overrides from `LEONIDA_CARD_BUFFERS_MIN_MB` / `LEONIDA_CARD_BUFFERS_MB`. | | `LEONIDA_CARD_COMPARE_JOIN` | on, `0` turns it off | yes | | | `leonida-gpu/host.rs` | Whether the compares of ranges of one copy in the card's memory whose pieces and result places follow each other go in one pass (`LEONIDA_CARD_COMPARE_JOIN=0`: a pass each, as before). | | `LEONIDA_CARD_HASH_LEN` | see the code | | | | `leonida-gpu/shadow.rs` | `LEONIDA_CARD_HASH_LEN=0`: the whole buffer. | | `LEONIDA_CARD_QUEUE` | on, `0` turns it off | yes | | | `leonida-gpu/shadow.rs` | Whether [`card_dirty`] takes the copies that changed from that queue (`LEONIDA_CARD_QUEUE=0`: it goes through every copy in the card's memory, as before). | -| `LEONIDA_CARD_REHASH_RUNS` | see the code | | | | `leonida-gpu/host.rs` +3 | ... are hashed in runs of pieces that touch, each piece once (`LEONIDA_CARD_REHASH_RUNS=1`; off by default), and not in a pass per range sent up.... | +| `LEONIDA_CARD_REHASH_RUNS` | see the code | | yes | | `leonida-gpu/host.rs` +3 | ... are hashed in runs of pieces that touch, each piece once (`LEONIDA_CARD_REHASH_RUNS=1`; off by default), and not in a pass per range sent up.... | | `LEONIDA_CARD_RESERVE_BUDGETS` | see the code | | | yes | `leonida-gpu/shadow.rs` | Whether the texture queue keeps the card room of the budgets as they are set, and windows go to the card up to the line title buffers do (`LEONIDA_CARD_RESERVE_BUDGETS=1`; off by default: unset or anything else is as bef... | | `LEONIDA_CARD_ROOM_FOR_BUFFERS` | see the code | | | | `leonida-gpu/shadow.rs` | Whether the texture queue leaves room on the card for the card copies of title buffers that are not made yet (`LEONIDA_CARD_ROOM_FOR_BUFFERS=1`; off by default). | | `LEONIDA_CARD_ROOM_FOR_TARGETS_MB` | see the code | | | | `leonida-gpu/resource.rs` | `LEONIDA_CARD_ROOM_FOR_TARGETS_MB` (3,072; 0: none, as before) less what such copies hold now. | | `LEONIDA_CARD_SPANS` | see the code | | | | `leonida-gpu/host/spans.rs` | Diagnostics: how long the card itself works on our submissions, by its own timestamps (`LEONIDA_CARD_SPANS=1`). | -| `LEONIDA_CARD_STEPS` | see the code | | | | `leonida-gpu/host/card_steps.rs` +3 | Steps of a submission that read title memory flights in the air may still write, done on the card in the flights' order instead of on the CPU after a wait for them (`LEONIDA_CARD_STEPS`, see [`stage`]). | +| `LEONIDA_CARD_STEPS` | see the code | | yes | | `leonida-gpu/host/card_steps.rs` +3 | Steps of a submission that read title memory flights in the air may still write, done on the card in the flights' order instead of on the CPU after a wait for them (`LEONIDA_CARD_STEPS`, see [`stage`]). | | `LEONIDA_CARD_STEPS_ON` | on, `0` turns it off | yes | | | `leonida-gpu/host/card_steps.rs` | `LEONIDA_AB=<s>,LEONIDA_CARD_STEPS_ON` measures what the planning costs against what it saves (off: no plan, the old wait for the flights where a step reads what they write). | | `LEONIDA_CARD_WINDOWS_MB` | see the code | | | yes | `leonida-gpu/shadow.rs` | ... says 1,536), and nothing for the windows outside buffers (`LEONIDA_CARD_WINDOWS_MB`, [`window_card_most`]), which are turned down from eight tenths of the card's budget on ([`window_room_for`]).... | | `LEONIDA_CLAIM_READ_FIRST` | on, `0` turns it off | yes | | | `leonida-gpu/texture.rs` | A change after the load is claimed by the next list. LEONIDA_CLAIM_READ_FIRST=0 restores the swaps. | | `LEONIDA_CLOSED_AHEAD` | on, `0` turns it off | yes | | yes | `leonida-gpu/list.rs` | `LEONIDA_CLOSED_AHEAD=0`: closed there, as before. | | `LEONIDA_COMMITTED_QUERY` | see the code | | | | `leonida-gpu/texture.rs` | Whether the two questions above and below are put to `VirtualQuery`, as they were (`LEONIDA_COMMITTED_QUERY=1`). | | `LEONIDA_COMMIT_FLOOR` | see the code | yes | | yes | `leonida-gpu/resource.rs` | `LEONIDA_COMMIT_FLOOR=1` (off by default; `LEONIDA_AB` can name it), and less left than `LEONIDA_COMMIT_FLOOR_MB` megabytes (4096 where it is unset: where `crate::residency` begins to speak of pressure by commit). | -| `LEONIDA_COMMIT_FLOOR_MB` | see the code | | | yes | `leonida-gpu/resource.rs` | `LEONIDA_AB` can name it), and less left than `LEONIDA_COMMIT_FLOOR_MB` megabytes (4096 where it is unset: where `crate::residency` begins to speak of pressure by commit). | +| `LEONIDA_COMMIT_FLOOR_MB` | see the code | | | yes | `leonida-gpu/resource.rs` | `LEONIDA_COMMIT_FLOOR=1` (off by default; `LEONIDA_AB` can name it), and less left than `LEONIDA_COMMIT_FLOOR_MB` megabytes (4096 where it is unset: where `crate::residency` begins to speak of pressure by commit). | | `LEONIDA_COMPOSE_NAN` | see the code | | | | `leonida-gpu/compose.rs` | A clamp to [0,1] that is safe for NaN and infinity (CLEAN, set when the pass is made from LEONIDA_COMPOSE_NAN): saturate() makes a NaN 0, which showed as black specks and a black sun where the upscaler or frame generatio... | | `LEONIDA_CONSTANT_MARKS` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | `LEONIDA_CONSTANT_MARKS=1` turns it on. | | `LEONIDA_CONTENT_TABLES` | off unless set and not `0` | yes | | yes | `leonida-gpu/draw.rs` | Off unless `LEONIDA_CONTENT_TABLES=1`; by turns under A/B. | | `LEONIDA_COPIES_IN_PLACE` | see the code | | | | `leonida-gpu/host/place.rs` | The title's buffer copies, done on the card at their place in the list (`LEONIDA_COPIES_IN_PLACE`, on by default; `0`: all at submission, on the CPU, as before). | -| `LEONIDA_COPYBACK_ELIDE` | see the code | | | yes | `leonida-gpu/shadow.rs` +1 | Copy-back elision (`LEONIDA_COPYBACK_ELIDE`): a big host copy in the card's memory that only the card ever changes is not copied back into title memory. | +| `LEONIDA_COPYBACK_ELIDE` | see the code | yes | | yes | `leonida-gpu/shadow.rs` +1 | Copy-back elision (`LEONIDA_COPYBACK_ELIDE`): a big host copy in the card's memory that only the card ever changes is not copied back into title memory. | | `LEONIDA_COPYBACK_ELIDE_MIN_MB` | see the code | | | | `leonida-gpu/shadow/elide.rs` | The smallest copy that is watched (`LEONIDA_COPYBACK_ELIDE_MIN_MB`, 4: a small buffer is the likely read back or query result). | | `LEONIDA_COPY_ASK` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_COPY_ASK=1` asks first, as before. | | `LEONIDA_COPY_BACK` | on, `0` turns it off | yes | | yes | `leonida-gpu/host.rs` +2 | Copies and resolves into textures the title fills go back the same way (`LEONIDA_COPY_BACK`; `0`: they stay on the host, as before): the title streams the small levels of a texture into memory by a copy, then samples the... | | `LEONIDA_COPY_BESIDE` | see the code | yes | | yes | `leonida-gpu/titlewrite.rs` | ...`]: the title's `memcpy`, `memmove` and `memset` are ours (`LEONIDA_COPY_BESIDE=1`; off unless asked for).... | -| `LEONIDA_COPY_CLIP` | see the code | | | | `leonida-gpu/list.rs` | `LEONIDA_COPY_CLIP=0`: passed on whole, as before). | +| `LEONIDA_COPY_CLIP` | see the code | | | | `leonida-gpu/list.rs` | Whether a texture to texture copy whose region does not fit its destination level is cut to what fits (on; `LEONIDA_COPY_CLIP=0`: passed on whole, as before). | | `LEONIDA_COPY_MODE` | see the code | | | | `leonida-gpu/copystat.rs` | `LEONIDA_COPY_MODE=plain` copies without the mapped-page guard, `none` skips the copies (both for timing only). | | `LEONIDA_COPY_OVER_TITLE` | see the code | | | | `leonida-gpu/list.rs` | The first copy into a texture of the title's: what it does not write is zeros, as in a texture that was an allocation of its own (`LEONIDA_COPY_OVER_TITLE=title`: what title memory holds, which may be another texture's:... | | `LEONIDA_COPY_SCOPED` | see the code | yes | yes | yes | `leonida-gpu/host.rs` +1 | ...t its place and wherever else the title shows their pages (`LEONIDA_COPY_SCOPED=1`; off by default; `LEONIDA_AB` can name it).... | @@ -215,10 +208,10 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_DIRECT_WRITES` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_DIRECT_WRITES=0` writes as before. | | `LEONIDA_DISPLAY_MODE` | see the code | | | | `leonida-gpu/dxgi.rs` | `LEONIDA_DISPLAY_MODE=WxH` if set (as a console reports the television it is plugged into: a Series X on a 1080p set lists a 1080p mode), else 3840x2160. shortcut: not yet the host display's own size by default; make it... | | `LEONIDA_DLSS_DEPTH_INVERTED` | see the code | | | | `leonida-gpu/dlss.rs` | ...`, `LEONIDA_DLSS_HDR=0\|1` (default: by the colour format), `LEONIDA_DLSS_DEPTH_INVERTED=0\|1` (default: by near > far), `LEONIDA_DLSS_SHARPNESS=<0..1>`.... | -| `LEONIDA_DLSS_DIR` | see the code | | | | `leonida-gpu/dlss.rs` +2 | `include`, `lib/Windows_x86_64`) is not part of this repository: the build links `nvsdk_ngx_d.lib` from `LEONIDA_DLSS_SDK`, and `nvngx_dlss.dll` is looked for in `LEONIDA_DLSS_DIR` (else beside the executable). | -| `LEONIDA_DLSS_HDR` | see the code | | | | `leonida-gpu/dlss.rs` | `LEONIDA_RENDER_SCALE`), `LEONIDA_DLSS_MV_SIGN=-1` (motion vectors the other way), `LEONIDA_DLSS_JITTER_SIGN=-1`, `LEONIDA_DLSS_HDR=0\|1` (default: by the colour format), `LEONIDA_DLSS_DEPTH_INVERTED=0\|1` (default: by nea... | -| `LEONIDA_DLSS_JITTER_SIGN` | see the code | | | | `leonida-gpu/dlss.rs` | `LEONIDA_RENDER_SCALE`), `LEONIDA_DLSS_MV_SIGN=-1` (motion vectors the other way), `LEONIDA_DLSS_JITTER_SIGN=-1`, `LEONIDA_DLSS_HDR=0\|1` (default: by the colour format), `LEONIDA_DLSS_DEPTH_INVERTED=0\|1` (default: by nea... | -| `LEONIDA_DLSS_MV_SIGN` | see the code | | | | `leonida-gpu/dlss.rs` | `LEONIDA_RENDER_SCALE`), `LEONIDA_DLSS_MV_SIGN=-1` (motion vectors the other way), `LEONIDA_DLSS_JITTER_SIGN=-1`, `LEONIDA_DLSS_HDR=0\|1` (default: by the colour format), `LEONIDA_DLSS_DEPTH_INVERTED=0\|1` (default: by nea... | +| `LEONIDA_DLSS_DIR` | see the code | | yes | | `leonida-gpu/dlss.rs` +2 | ... `LEONIDA_DLSS_SDK`, and `nvngx_dlss.dll` is looked for in `LEONIDA_DLSS_DIR` (else beside the executable).... | +| `LEONIDA_DLSS_HDR` | see the code | | | | `leonida-gpu/dlss.rs` | ...ion vectors the other way), `LEONIDA_DLSS_JITTER_SIGN=-1`, `LEONIDA_DLSS_HDR=0\|1` (default: by the colour format), `LEONIDA_DLSS_DEPTH_INVERTED=0\|1` (default: by near > far), `LEONIDA_DLSS_SHARPNESS=<0..1>`.... | +| `LEONIDA_DLSS_JITTER_SIGN` | see the code | | | | `leonida-gpu/dlss.rs` | ... `LEONIDA_DLSS_MV_SIGN=-1` (motion vectors the other way), `LEONIDA_DLSS_JITTER_SIGN=-1`, `LEONIDA_DLSS_HDR=0\|1` (default: by the colour format), `LEONIDA_DLSS_DEPTH_INVERTED=0\|1` (default: by near > far), `LEONIDA_DLSS_... | +| `LEONIDA_DLSS_MV_SIGN` | see the code | | | | `leonida-gpu/dlss.rs` | ..., which the render scale decides: `LEONIDA_RENDER_SCALE`), `LEONIDA_DLSS_MV_SIGN=-1` (motion vectors the other way), `LEONIDA_DLSS_JITTER_SIGN=-1`, `LEONIDA_DLSS_HDR=0\|1` (default: by the colour format), `LEONIDA_DLSS_DE... | | `LEONIDA_DLSS_PRESET` | see the code | | | | `leonida-gpu/dlss.rs` +1 | `LEONIDA_DLSS_PRESET=J\|K\|L\|M`: the model, for every mode (unset: the DLL's default; 310.9.16 uses K, the DLSS 4 transformer model, for Quality). | | `LEONIDA_DLSS_QUALITY` | see the code | | | | `leonida-gpu/dlss.rs` | `LEONIDA_DLSS_QUALITY` (0 performance, 1 balanced, 2 quality, 3 ultra performance, 5 DLAA; unset: by the sizes, `crate::list::dlss_mode`, which the render scale decides: `LEONIDA_RENDER_SCALE`), `LEONIDA_DLSS_MV_SIGN=-1`... | | `LEONIDA_DLSS_SDK` | see the code | | | | `leonida-gpu/build.rs` +2 | The `dlss` feature links the DLSS SDK's loader (`nvsdk_ngx_d.lib`, the dynamic-CRT one) from `LEONIDA_DLSS_SDK`. | @@ -228,7 +221,7 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_DUMP_VOLUMES` | off unless set and not `0` | | | | `leonida-gpu/capture.rs` | With `LEONIDA_DUMP_VOLUMES` set (and `LEONIDA_CAPTURE=<folder>`): the first time each 33x33x33 or 64x64x64 R16G16B16A16_FLOAT 3D texture is sampled by a list, and again [`VOLUME_AGAIN`] frames later, its texels are read... | | `LEONIDA_DYNAMIC_BITS` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor.rs` +1 | Whether free dynamic slots are searched for a word of the set at a time, and a list's tables given back under one taking of the locks (`LEONIDA_DYNAMIC_BITS=0`: the search looks at slot after slot and each table is given... | | `LEONIDA_DYNAMIC_LEASE` | see the code | | | | `leonida-gpu/descriptor/host.rs` | Whether dynamic slots come out of per-thread leases (`LEONIDA_DYNAMIC_LEASE=0`: one search under the lock each, as before). | -| `LEONIDA_DYNAMIC_SLOTS` | see the code | | yes | | `leonida-gpu/descriptor/host.rs` +2 | `LEONIDA_DYNAMIC_SLOTS` sets the most). 2^18 ran out in the title's bigger places (session play-1125-0127: 27,000 to 35,000 tables a frame, up to 3,285 of them refused, with 2,639 indirect draws and dispatches). | +| `LEONIDA_DYNAMIC_SLOTS` | see the code | | yes | | `leonida-gpu/descriptor/host.rs` +2 | ... the room (a host that takes more than [`PORTABLE_VIEWS`]; `LEONIDA_DYNAMIC_SLOTS` sets the most). 2^18 ran out in the title's bigger places (session play-1125-0127: 27,000 to 35,000 tables a frame, up to 3,285 of them r... | | `LEONIDA_DYNAMIC_WAIT` | see the code | yes | | | `leonida-gpu/host.rs` | (Counts the wait, and with `LEONIDA_DYNAMIC_WAIT=1` waits for the next landing without the submission lock before it settles everything.) | | `LEONIDA_E5_TARGETS` | see the code | | | | `leonida-gpu/resource.rs` | R16G16B16A16_FLOAT (10), 64 bits a texel, or with `LEONIDA_E5_TARGETS=r11g11b10` R11G11B10_FLOAT (26): 32 bits a texel as on the console, unsigned and without alpha as R9G9B9E5 is, with 6, 6 and 5 bits of mantissa agains... | | `LEONIDA_EARLY_ALL` | see the code | | | | `leonida-gpu/pipeline/known.rs` +1 | `LEONIDA_EARLY_ALL=1`: every title pipeline is started at creation, requested before or not, so that the driver's own cache holds it for later runs. | @@ -239,10 +232,10 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_EXCHANGE_SITES` | see the code | | | yes | `leonida-gpu/shader_cache.rs` +1 | How many exchanges of a console wave64 program in two host waves get dwords of their own (`LEONIDA_EXCHANGE_SITES`, 24 unless set; 0: all share one pair, as before). | | `LEONIDA_EXP_BATCH_NO_WAIT` | see the code | yes | | | `leonida-gpu/indirect.rs` +1 | Timing experiments (`LEONIDA_AB=<s>,LEONIDA_EXP_BATCH_NO_WAIT` and `..._WAIT_SOURCES`): nothing, or only the unordered access to the buffers the records are read from. | | `LEONIDA_EXP_BATCH_WAIT_SOURCES` | see the code | yes | | | `leonida-gpu/indirect.rs` | | -| `LEONIDA_EXP_EMPTY_DISPATCHES` | see the code | | | | `leonida-gpu/indirect/batch.rs` | ...e), `LEONIDA_EXP_EMPTY_DRAWS` (bit 1: draws of no vertex), `LEONIDA_EXP_EMPTY_DISPATCHES` (bit 2: indirect dispatches of no group; what the title's compute passes make is stale or missing).... | -| `LEONIDA_EXP_EMPTY_DRAWS` | see the code | | | | `leonida-gpu/indirect/batch.rs` | `LEONIDA_EXP_EMPTY_MESH` (bit 0: mesh dispatches of no group; the world's geometry is gone), `LEONIDA_EXP_EMPTY_DRAWS` (bit 1: draws of no vertex), `LEONIDA_EXP_EMPTY_DISPATCHES` (bit 2: indirect dispatches of no group;... | +| `LEONIDA_EXP_EMPTY_DISPATCHES` | see the code | yes | | | `leonida-gpu/indirect/batch.rs` | ...e), `LEONIDA_EXP_EMPTY_DRAWS` (bit 1: draws of no vertex), `LEONIDA_EXP_EMPTY_DISPATCHES` (bit 2: indirect dispatches of no group; what the title's compute passes make is stale or missing).... | +| `LEONIDA_EXP_EMPTY_DRAWS` | see the code | yes | | | `leonida-gpu/indirect/batch.rs` | `LEONIDA_EXP_EMPTY_MESH` (bit 0: mesh dispatches of no group; the world's geometry is gone), `LEONIDA_EXP_EMPTY_DRAWS` (bit 1: draws of no vertex), `LEONIDA_EXP_EMPTY_DISPATCHES` (bit 2: indirect dispatches of no group;... | | `LEONIDA_EXP_EMPTY_INDIRECT` | see the code | yes | | yes | `leonida-gpu/draw.rs` | A buffer of 256 zeros on the card, for the empty indirect executions of `LEONIDA_EXP_EMPTY_INDIRECT` ([`State::execute_indirect`]). | -| `LEONIDA_EXP_EMPTY_MESH` | see the code | | | | `leonida-gpu/indirect/batch.rs` | `LEONIDA_EXP_EMPTY_MESH` (bit 0: mesh dispatches of no group; the world's geometry is gone), `LEONIDA_EXP_EMPTY_DRAWS` (bit 1: draws of no vertex), `LEONIDA_EXP_EMPTY_DISPATCHES` (bit 2: indirect dispatches of no group;... | +| `LEONIDA_EXP_EMPTY_MESH` | see the code | yes | | | `leonida-gpu/indirect/batch.rs` | `LEONIDA_EXP_EMPTY_MESH` (bit 0: mesh dispatches of no group; the world's geometry is gone), `LEONIDA_EXP_EMPTY_DRAWS` (bit 1: draws of no vertex), `LEONIDA_EXP_EMPTY_DISPATCHES` (bit 2: indirect dispatches of no group;... | | `LEONIDA_EXP_MESH_ONE_PIXEL` | see the code | yes | | | `leonida-gpu/draw.rs` | `LEONIDA_EXP_MESH_SKIP` (what the mesh draws cost the card in all) and `LEONIDA_EXP_MESH_ONE_PIXEL` (what is left of it without their pixels: the mesh programs' own share). | | `LEONIDA_EXP_MESH_SKIP` | see the code | yes | | yes | `leonida-gpu/draw.rs` | `LEONIDA_EXP_MESH_SKIP` (what the mesh draws cost the card in all) and `LEONIDA_EXP_MESH_ONE_PIXEL` (what is left of it without their pixels: the mesh programs' own share). | | `LEONIDA_EXP_NO_ALIAS_COPY` | see the code | yes | | yes | `leonida-gpu/texture.rs` | Timing experiment (`LEONIDA_AB=<s>,LEONIDA_EXP_NO_ALIAS_COPY`): no copy is recorded while it is on (the views show what they were last given), so a phase's frame time against the next one's says what the copies cost the... | @@ -255,32 +248,32 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_FENCE_CHECK` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_FENCE_CHECK=0`: goes on, as before. | | `LEONIDA_FETCH_CHECK` | see the code | | yes | | `leonida-gpu/host/menu.rs` +3 | Pieces of card copies that came down while a later flight was writing them (`LEONIDA_FETCH_CHECK`, with `LEONIDA_RELAY_COPY`). | | `LEONIDA_FG_GBUFFER` | see the code | | | yes | `leonida-gpu/fg.rs` +1 | Whether the G-buffer pass's depth and velocity targets are frame generation's inputs where no upscale hands any over (`LEONIDA_FG_GBUFFER=0`: not, as before). | -| `LEONIDA_FG_HUDLESS` | see the code | | | | `leonida-gpu/fg.rs` | `LEONIDA_FG_HUDLESS`, on, `0` off): the picture without the interface. | -| `LEONIDA_FG_LIMIT_FPS` | see the code | | | | `leonida-gpu/fg.rs` +1 | `LEONIDA_FG_LIMIT_FPS=<n>`: Reflex holds the frames **shown** to n a second (its frame limit, `frameLimitUs`), so that they come evenly; unset or 0: no limit, as before. | -| `LEONIDA_FG_MARKERS` | see the code | | | | `leonida-gpu/fg.rs` +3 | `INTERFACE_COMPOSITE`, `before_target_draw`, `hudless_for`). - With `LEONIDA_FG_MARKERS=1`, Reflex's frames at the title's own events ([`frame_begins`], [`title_submits`], [`title_presents`]): its sleep where the title b... | +| `LEONIDA_FG_HUDLESS` | see the code | | | | `leonida-gpu/fg.rs` | ...s `Present`. - [`before_target_draw`] (from `crate::draw`; `LEONIDA_FG_HUDLESS`, on, `0` off): the picture without the interface.... | +| `LEONIDA_FG_LIMIT_FPS` | see the code | | yes | | `leonida-gpu/fg.rs` +1 | `LEONIDA_FG_LIMIT_FPS=<n>`: Reflex holds the frames **shown** to n a second (its frame limit, `frameLimitUs`), so that they come evenly; unset or 0: no limit, as before. | +| `LEONIDA_FG_MARKERS` | see the code | | | | `leonida-gpu/fg.rs` +3 | ...E_COMPOSITE`, `before_target_draw`, `hudless_for`). - With `LEONIDA_FG_MARKERS=1`, Reflex's frames at the title's own events ([`frame_begins`], [`title_submits`], [`title_presents`]): its sleep where the title begins a f... | | `LEONIDA_FG_REFLEX` | see the code | | | | `leonida-gpu/fg.rs` | `LEONIDA_FG_REFLEX=0`: Reflex left off and its sleep not taken (to tell its cost from the rest). | | `LEONIDA_FG_WITH_RT` | see the code | | | | `leonida-gpu/fg.rs` +1 | `LEONIDA_FG_WITH_RT=1` starts it anyway. | -| `LEONIDA_FIDELITYFX_DIR` | see the code | | | | `leonida-gpu/fsr.rs` +1 | ... the swap chain stays FidelityFX's until the next start. - `LEONIDA_FIDELITYFX_DIR`: the folder of AMD's signed `amd_fidelityfx_loader_dx12.dll` and `amd_fidelityfx_framegeneration_dx12.dll` (the FidelityFX SDK's `bin`;... | +| `LEONIDA_FIDELITYFX_DIR` | see the code | | yes | | `leonida-gpu/fsr.rs` +1 | ... the swap chain stays FidelityFX's until the next start. - `LEONIDA_FIDELITYFX_DIR`: the folder of AMD's signed `amd_fidelityfx_loader_dx12.dll` and `amd_fidelityfx_framegeneration_dx12.dll` (the FidelityFX SDK's `bin`;... | | `LEONIDA_FILL_TITLE` | see the code | yes | yes | | `leonida-gpu/host.rs` +2 | Whether a small fill of upload memory, or copy of a title buffer, goes on without waiting for flights when the title itself wrote the memory since they were given it (`LEONIDA_FILL_TITLE=1`; off by default). | | `LEONIDA_FIRSTLANE_OWN` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | `LEONIDA_FIRSTLANE_OWN=1` takes the host wave's own first lane, exact when the value is the same in every lane of the console wave (the ray-tracing builder's scans read a sum of scalars this way, inside a loop whose exit... | | `LEONIDA_FIRST_HALF` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | Runs `translate` with first halves of interpolations evaluated as the pair they start: the translation of a program refused with [`FIRST_HALF`] (`LEONIDA_FIRST_HALF=0`: refused again, as before). | -| `LEONIDA_FPS_CAP` | see the code | | | | `leonida-gpu/frame.rs` +6 | `LEONIDA_FPS_CAP`. | +| `LEONIDA_FPS_CAP` | see the code | | | | `leonida-gpu/frame.rs` +6 | What `LEONIDA_FPS_CAP` says, read as `crate::frame` reads it. | | `LEONIDA_FPS_LINE` | see the code | | | | `leonida-gpu/host/menu.rs` | Whether the frame-rate line is shown at the top while the menu is closed (`LEONIDA_FPS_LINE=0`: not; the menu changes it). | -| `LEONIDA_FRAME_GEN` | see the code | | | | `leonida-gpu/dlss.rs` +4 | `LEONIDA_FRAME_GEN=2\|3\|4` (frames shown per rendered one; unset or 1: off) with the SDK's signed DLLs in `LEONIDA_STREAMLINE_DIR` (sl.interposer, sl.common, sl.dlss_g, sl.reflex, sl.pcl, nvngx_dlssg). | +| `LEONIDA_FRAME_GEN` | see the code | | yes | | `leonida-gpu/dlss.rs` +4 | `LEONIDA_FRAME_GEN=2\|3\|4` (frames shown per rendered one; unset or 1: off) with the SDK's signed DLLs in `LEONIDA_STREAMLINE_DIR` (sl.interposer, sl.common, sl.dlss_g, sl.reflex, sl.pcl, nvngx_dlssg). | | `LEONIDA_FRAME_PEEK` | see the code | | | | `leonida-gpu/draw.rs` | With `peek` the shared word is read first and written only when the frame changed (`LEONIDA_FRAME_PEEK=0`: swapped at every ask, as before). | | `LEONIDA_FRONTS_LEAN` | on, `0` turns it off | yes | | yes | `leonida-gpu/host.rs` | ... thread ([`fronts_let_go`]), not on the submitting thread (`LEONIDA_FRONTS_LEAN=0`: as before; `LEONIDA_AB` can turn it on and off while the title runs).... | -| `LEONIDA_FSR_FRAMEGEN` | see the code | | | | `leonida-gpu/fsr.rs` +4 | ... tree's presenter and to the inputs [`crate::fg`] keeps. - `LEONIDA_FSR_FRAMEGEN=1` at the start: the presenter's swap chain is FidelityFX's frame interpolation swap chain, and each present is told the depth and motion v... | +| `LEONIDA_FSR_FRAMEGEN` | see the code | | yes | | `leonida-gpu/fsr.rs` +4 | ... tree's presenter and to the inputs [`crate::fg`] keeps. - `LEONIDA_FSR_FRAMEGEN=1` at the start: the presenter's swap chain is FidelityFX's frame interpolation swap chain, and each present is told the depth and motion v... | | `LEONIDA_FSR_FRAMEGEN_DEBUG` | see the code | | | | `leonida-gpu/fsr.rs` | Their signatures are checked before they are loaded. - `LEONIDA_FSR_FRAMEGEN_DEBUG=1`: FidelityFX draws its tear and pacing lines. | | `LEONIDA_FULL_CARD_PASS` | see the code | | | | `leonida-gpu/draw.rs` | Whether a pass over the textures picked by index on a full card holds back the slots that need a new host copy (`LEONIDA_FULL_CARD_PASS=0`: no, as before: they stay due, each pass looks at the same ones again and stops a... | | `LEONIDA_GPU_LOAD_MS` | see the code | | | | `leonida-gpu/queue.rs` | What the title's GPU time is made to look like, in ticks (`LEONIDA_GPU_LOAD_MS`; unset: as it is). | -| `LEONIDA_GPU_READ_ONLY_NO_BACK` | see the code | | | yes | `leonida-gpu/shadow.rs` +1 | Whether shader writes declared over GPU read-only title memory are left out of the copy-back (`LEONIDA_GPU_READ_ONLY_NO_BACK`, on unless `0`; `LEONIDA_AB` switches it by turns): the console cannot have a shader write the... | +| `LEONIDA_GPU_READ_ONLY_NO_BACK` | see the code | yes | | yes | `leonida-gpu/shadow.rs` +1 | Whether shader writes declared over GPU read-only title memory are left out of the copy-back (`LEONIDA_GPU_READ_ONLY_NO_BACK`, on unless `0`; `LEONIDA_AB` switches it by turns): the console cannot have a shader write the... | | `LEONIDA_GPU_TIMING` | off unless set and not `0` | | | yes | `leonida-gpu/copystat.rs` +1 | With `LEONIDA_GPU_TIMING`: a GPU timestamp before each noted command and at the end, and where they are read back. | | `LEONIDA_GPU_TIMING_KINDS` | see the code | | | | `leonida-gpu/copystat.rs` | (`LEONIDA_GPU_TIMING_KINDS=<n>`: so many of the heaviest are listed instead of forty.) | | `LEONIDA_GPU_TIMING_SLOW_MS` | see the code | | | | `leonida-gpu/host.rs` | From how many milliseconds a list of the timing run is logged as slow, with what its time is made of (`LEONIDA_GPU_TIMING_SLOW_MS`, 50). | | `LEONIDA_GROUP_PACK` | see the code | | | yes | `leonida-gpu/draw.rs` +6 | `LEONIDA_GROUP_PACK=<K>`: the most console groups of 32 threads a host group runs (2, 4 or 8; 0, 1 or unset: one to a group, as the console does). | | `LEONIDA_GUARD_ASK` | see the code | | | | `leonida-gpu/watch.rs` | `LEONIDA_GUARD_ASK=1` asks every time, as before. | | `LEONIDA_GUARD_HOLES` | see the code | | | | `leonida-gpu/watch.rs` | `LEONIDA_GUARD_HOLES=0` looks at the first address only, as before. | -| `LEONIDA_GUARD_HOT` | see the code | yes | | | `leonida-gpu/watch.rs` | `LEONIDA_GUARD_HOT=0`: 3 ms as before); - view memory is not asked of the kernel, which refuses it ([`VIEWS`]; ~300 refused askings a frame). | +| `LEONIDA_GUARD_HOT` | see the code | yes | | | `leonida-gpu/watch.rs` | Also with the switch: - a block the title writes again soon after each time it was taken rests longer ([`hot_rest`]; `LEONIDA_GUARD_HOT=0`: 3 ms as before); - view memory is not asked of the kernel, which refuses it ([`V... | | `LEONIDA_GUARD_REST` | on, `0` turns it off | yes | | | `leonida-gpu/watch.rs` | How long a block the title has just opened by a write is left open by those that take it (`LEONIDA_GUARD_REST=<microseconds>`, 3,000 unless given; `0`: not at all, as before). 220 of a frame's 586 faults came within 3 ms... | | `LEONIDA_HEAP_ID_GUARD` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor.rs` +1 | Runs of dynamic slots a release refused since the last call (`LEONIDA_HEAP_ID_GUARD`), logged with the recording line. | | `LEONIDA_HEAP_PASS_ASIDE` | see the code | | | | `leonida-gpu/host/aside.rs` | `LEONIDA_HEAP_PASS_ASIDE=0`: done where it is needed, as before. | @@ -305,17 +298,17 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_INDIRECT_REST` | see the code | | | yes | `leonida-gpu/indirect.rs` | Whether a record that does not fit in what is left of its list's budget takes the rest, so that every record after it runs empty too (`LEONIDA_INDIRECT_REST=1`; off by default so one oversized record takes nothing and la... | | `LEONIDA_INDIRECT_RUNS` | off unless set and not `0` | | | yes | `leonida-gpu/draw.rs` | `LEONIDA_INDIRECT_RUNS=1` (diagnostics; off): [`INDIRECT_RUNS`] counted, which copies every indirect execution's root arguments. | | `LEONIDA_INDIRECT_WIDE` | see the code | | | yes | `leonida-gpu/indirect.rs` | ...h, 2^20 ([`SOURCE`]'s GROUPS) what is bounded here anyway (`LEONIDA_INDIRECT_WIDE=0`: 65,535; a record that asks for more still runs 65,535).... | -| `LEONIDA_INDIRECT_WINDOW` | see the code | | | | `leonida-gpu/draw.rs` +3 | Whether indirect draws that read record after record of one argument buffer are clamped a window at a time (`LEONIDA_INDIRECT_WINDOW=1`; off by default). | +| `LEONIDA_INDIRECT_WINDOW` | see the code | | yes | | `leonida-gpu/draw.rs` +3 | Whether indirect draws that read record after record of one argument buffer are clamped a window at a time (`LEONIDA_INDIRECT_WINDOW=1`; off by default). | | `LEONIDA_INPLACE` | see the code | | | | `leonida-gpu/inplace.rs` | `LEONIDA_INPLACE`: 0 (unset) off. 1: a window of title memory outside buffers that lies in private memory committed whole is not copied: a part of the title's allocation is opened as a host heap and the window is a buffe... | | `LEONIDA_INPLACE_MB` | see the code | | | | `leonida-gpu/inplace.rs` | The most title memory in place at once, in bytes (`LEONIDA_INPLACE_MB`, 4096): opening locks the pages into the PC's memory, also those the title never touched. | | `LEONIDA_INPLACE_PROBE` | see the code | | | | `leonida-gpu/host.rs` +1 | This file holds the two openings Direct3D has, a probe that says what this PC's driver makes of them (`LEONIDA_INPLACE_PROBE`), and a census of which title memory could be opened. | | `LEONIDA_INPLACE_PROBE_MB` | see the code | | | | `leonida-gpu/inplace.rs` | | | `LEONIDA_JOIN_COPIES` | see the code | | yes | | `leonida-gpu/host.rs` +3 | Whether a title buffer copy that continues the one recorded before it in its list becomes one step with it (`LEONIDA_JOIN_COPIES=1`; off by default). | -| `LEONIDA_JOIN_LISTS` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_JOIN_LISTS`, 48). | -| `LEONIDA_JOIN_PARTS` | see the code | yes | | yes | `leonida-gpu/host.rs` +4 | How many parts of submissions, and lists, the line's thread gives to the host as one (`LEONIDA_JOIN_PARTS=<n>`; off by default, 1; `LEONIDA_JOIN_LISTS`, 48). | +| `LEONIDA_JOIN_LISTS` | see the code | | | | `leonida-gpu/host.rs` | How many parts of submissions, and lists, the line's thread gives to the host as one (`LEONIDA_JOIN_PARTS=<n>`; off by default, 1; `LEONIDA_JOIN_LISTS`, 48). | +| `LEONIDA_JOIN_PARTS` | see the code | yes | yes | yes | `leonida-gpu/host.rs` +4 | How many parts of submissions, and lists, the line's thread gives to the host as one (`LEONIDA_JOIN_PARTS=<n>`; off by default, 1; `LEONIDA_JOIN_LISTS`, 48). | | `LEONIDA_JOIN_PARTS_AB` | see the code | | | yes | `leonida-gpu/host.rs` | Named in `LEONIDA_AB`: the parts asked for (8 when not asked) against `LEONIDA_JOIN_PARTS_AB` (1 when not set). | | `LEONIDA_KEEP_BY_LIST` | on, `0` turns it off | yes | | yes | `leonida-gpu/descriptor/host.rs` | `LEONIDA_KEEP_BY_LIST=0`: each slot keeps its own, as before; by turns under A/B (a slot keeps what it showed during a phase without it until it is made again without it). | -| `LEONIDA_KEEP_FREED` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_KEEP_FREED=0`: it is given back as before). | +| `LEONIDA_KEEP_FREED` | see the code | | | | `leonida-gpu/host.rs` | Whether memory the card was given stays with it while there is room (on by default; `LEONIDA_KEEP_FREED=0`: it is given back as before). | | `LEONIDA_KEEP_SHOWN` | see the code | yes | | | `leonida-gpu/descriptor/host.rs` +1 | ...it shows until the new one is made and its upload has run (`LEONIDA_KEEP_SHOWN`): 0: never, it reads as zeros, then as the neutral texture; 1: one of the same kind in another place or size; 2: any of the same dimension.... | | `LEONIDA_KEEP_SNAPSHOTS` | see the code | | | | `leonida-gpu/shadow.rs` | Whether a copy's snapshot is kept from one submission to the next and only the pieces that changed in between are taken again (`LEONIDA_KEEP_SNAPSHOTS=1`; off by default). | | `LEONIDA_KEEP_SNAPSHOTS_MB` | see the code | | | | `leonida-gpu/shadow.rs` | `LEONIDA_KEEP_SNAPSHOTS_MB`, 256 unless set (it was 768: run 80, with kept snapshots beside copies in the card's memory, ran the PC out of memory in 27 s; kept snapshots are the PC's memory, all of it resident). | @@ -327,7 +320,7 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_LAND_BESIDE` | see the code | | | | `leonida-gpu/land.rs` | With `LEONIDA_LAND_BESIDE` (on by default) title memory that is a view of the title's physical pages is written through a view of our own of the same pages ([`crate::inplace::beside`]). | | `LEONIDA_LAND_ECHO` | on, `0` turns it off | yes | | | `leonida-gpu/shadow.rs` +1 | Whether a refresh looks if what counts as written is only what a landing put there, and then sends nothing of it up (`LEONIDA_LAND_ECHO=0`: it copies and sends it, as before). | | `LEONIDA_LAND_SAME` | on, `0` turns it off | yes | | | `leonida-gpu/land.rs` | `LEONIDA_LAND_SAME=0`: put and noted as before. | -| `LEONIDA_LAND_SKIP` | see the code | | | | `leonida-gpu/land.rs` | `LEONIDA_LAND_SKIP=1`, off by default: counted either way). | +| `LEONIDA_LAND_SKIP` | see the code | | | | `leonida-gpu/land.rs` | Whether pieces an earlier fetch holds as they are now are left out ([`Had`]; `LEONIDA_LAND_SKIP=1`, off by default: counted either way). | | `LEONIDA_LAND_TAKEN` | see the code | | | | `leonida-gpu/land.rs` | Whether a copy a landing went through is noted as up to date with it (`LEONIDA_LAND_TAKEN=0`: it is not, and the next refresh copies the 64 KiB again and sends them up to the card, as before). | | `LEONIDA_LAND_THREADS` | see the code | | | | `leonida-gpu/land.rs` | How many threads land, the relay's own counted (`LEONIDA_LAND_THREADS`). | | `LEONIDA_LATE_WAIT` | see the code | | | yes | `leonida-gpu/host.rs` +2 | ...ission is waited for, so CPU and GPU never overlap (unless `LEONIDA_LATE_WAIT=1`, see [`late`]); overlap them with per-submission fences once more than clears run.... | @@ -341,7 +334,7 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_LDS_FLAGS` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | `LEONIDA_LDS_FLAGS=0` turns this off. | | `LEONIDA_LENT_HEAP` | see the code | | | | `leonida-gpu/descriptor.rs` | `LEONIDA_LENT_HEAP=0`: none, such a dispatch is dropped, as before. | | `LEONIDA_LEVELS_MIN_KB` | see the code | | | | `leonida-gpu/tiles.rs` | The bytes from which a texture is made this way: a megabyte, or `LEONIDA_LEVELS_MIN_KB`. | -| `LEONIDA_LEVELS_ON_DEMAND` | see the code | | | | `leonida-gpu/tiles.rs` | Off unless `LEONIDA_LEVELS_ON_DEMAND=1`. | +| `LEONIDA_LEVELS_ON_DEMAND` | see the code | | | | `leonida-gpu/tiles.rs` | ...osted`); every other texture is made as before. Off unless `LEONIDA_LEVELS_ON_DEMAND=1`.... | | `LEONIDA_LIBRARY_HANDLE` | see the code | | | | `leonida-gpu/pipeline/library.rs` | `LEONIDA_LIBRARY_HANDLE=0`: closed, as before. | | `LEONIDA_LIBRARY_LOCK` | see the code | | | | `leonida-gpu/pipeline/library.rs` | `LEONIDA_LIBRARY_LOCK=1`: one call at a time, as before. | | `LEONIDA_LIBRARY_MAP` | see the code | | | | `leonida-gpu/pipeline/library.rs` | `LEONIDA_LIBRARY_MAP=0`: read and written through buffers, as before. | @@ -349,30 +342,30 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_LIBRARY_STATIC_SAMPLERS` | see the code | | | yes | `leonida-gpu/pipeline/library.rs` +2 | `LEONIDA_LIBRARY_STATIC_SAMPLERS=1`: under their plain names on NVIDIA too, for comparison. | | `LEONIDA_LIBRARY_TRIM` | see the code | | | | `leonida-gpu/pipeline/library.rs` | `LEONIDA_LIBRARY_TRIM=0`: the pages stay until Windows takes them. | | `LEONIDA_LIGHT_REFRESH` | see the code | | | | `leonida-gpu/host.rs` +1 | Whether the refreshes of host copies go the light way (`LEONIDA_LIGHT_REFRESH=0`: as before): view memory nothing wrote since it was last asked about is known by its bits ([`PUBLISHED`]), a copy nothing of whose range ch... | -| `LEONIDA_LIST_ALIAS_EXACT` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor/host.rs` +1 | `LEONIDA_LIST_ALIAS_EXACT=0`: as before. | +| `LEONIDA_LIST_ALIAS_EXACT` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor/host.rs` +1 | On by default; `LEONIDA_LIST_ALIAS_EXACT=0`: as before. | | `LEONIDA_LIST_FRONTS` | see the code | yes | | yes | `leonida-gpu/host.rs` | Whether a list's steps are gone through for what they refresh once, when the list is closed, by the thread that closes it (`LEONIDA_LIST_FRONTS=0`: by the thread that prepares the submission, for every submission, as bef... | -| `LEONIDA_LIST_POOL` | see the code | | | | `leonida-gpu/list.rs` | `LEONIDA_LIST_POOL=0`: each is made new and thrown away, as before). | +| `LEONIDA_LIST_POOL` | see the code | | | | `leonida-gpu/list.rs` | Whether host lists that have run are used again (on by default; `LEONIDA_LIST_POOL=0`: each is made new and thrown away, as before). | | `LEONIDA_LIST_SLOTS` | see the code | | | | `leonida-gpu/draw.rs` | For the frame listing, after a draw whose shader `LEONIDA_LIST_SLOTS` names: the heap slots it will pick textures from by index, and what the title and the host hold there (one `~slot` line each), with the words they wer... | | `LEONIDA_LIST_VIEWS` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor/host.rs` | Whether a list makes a view its tables hold once (`LEONIDA_LIST_VIEWS=0`: for every table). | -| `LEONIDA_MAPPED_BY_PAGE` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_MAPPED_BY_PAGE=1`: by page. | +| `LEONIDA_MAPPED_BY_PAGE` | see the code | | | | `leonida-gpu/texture.rs` | ... pass over the heap's views at 90-160 ms a frame (run 81). `LEONIDA_MAPPED_BY_PAGE=1`: by page.... | | `LEONIDA_MAPPED_BY_VIEWS` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_MAPPED_BY_VIEWS=0`: the host is asked, as before. | -| `LEONIDA_MAP_THREADS` | off unless set and not `0` | | | | `leonida-gpu/host/menu.rs` +3 | With `LEONIDA_MAP_THREADS=1` (the NVIDIA launcher's) the GPU's page mappings came here range by range, a page after the other at 0.2-4 ms each in the world: single holds of 23-69 ms from this function, and 110 ms a frame... | +| `LEONIDA_MAP_THREADS` | see the code | yes | yes | | `leonida-gpu/host/menu.rs` +3 | With `LEONIDA_MAP_THREADS=1` (the NVIDIA launcher's) the GPU's page mappings came here range by range, a page after the other at 0.2-4 ms each in the world: single holds of 23-69 ms from this function, and 110 ms a frame... | | `LEONIDA_MEMORY_CARD_MB` | see the code | | | | `leonida-gpu/shadow.rs` | At most so much on the card's own memory (4 GiB unless `LEONIDA_MEMORY_CARD_MB` says otherwise), and while it has room; past that the side shaders see is in the PC's memory. | | `LEONIDA_MEMORY_DUMP` | see the code | | | | `leonida-gpu/memory.rs` | `LEONIDA_MEMORY_DUMP=<folder>`: when a file `go` appears there, the arenas as the card holds them are copied out and written (`arena-<n>.bin`), with `pages.txt` (title page, arena, offset) and the structures the walking... | | `LEONIDA_MEMORY_MAP` | see the code | | yes | yes | `leonida-gpu/copystat.rs` +1 | `LEONIDA_MEMORY_MAP=0` leaves the walk out. | | `LEONIDA_MENU` | see the code | | | | `leonida-gpu/host/trainer.rs` +3 | Whether the menu is on: unless `LEONIDA_MENU=0`. | -| `LEONIDA_MENU_ARGS` | see the code | | | | `leonida-gpu/host/menu.rs` +1 | ... RESTART" starts play.ps1 again (`LEONIDA_MENU_PLAY`, with `LEONIDA_MENU_ARGS`) and ends this run.... | -| `LEONIDA_MENU_CONSOLE` | see the code | | | | `leonida-gpu/host/menu.rs` +1 | | -| `LEONIDA_MENU_FILE` | see the code | | | | `leonida-gpu/host/menu.rs` +1 | Most settings are read once at start, so a change is saved to the file `LEONIDA_MENU_FILE` names (play.ps1 sets it to the play folder's settings.txt and applies it at every start) and takes effect at the next start; "SAV... | -| `LEONIDA_MENU_PLAY` | see the code | | | | `leonida-gpu/host/menu.rs` +1 | ... the next start; "SAVE AND RESTART" starts play.ps1 again (`LEONIDA_MENU_PLAY`, with `LEONIDA_MENU_ARGS`) and ends this run.... | -| `LEONIDA_MENU_SMOOTH_MOTION` | see the code | | | | `leonida-gpu/host/menu.rs` +1 | | +| `LEONIDA_MENU_ARGS` | see the code | | yes | | `leonida-gpu/host/menu.rs` +1 | ... RESTART" starts play.ps1 again (`LEONIDA_MENU_PLAY`, with `LEONIDA_MENU_ARGS`) and ends this run.... | +| `LEONIDA_MENU_CONSOLE` | see the code | | yes | | `leonida-gpu/host/menu.rs` +1 | | +| `LEONIDA_MENU_FILE` | see the code | | yes | | `leonida-gpu/host/menu.rs` +1 | Most settings are read once at start, so a change is saved to the file `LEONIDA_MENU_FILE` names (play.ps1 sets it to the play folder's settings.txt and applies it at every start) and takes effect at the next start; "SAV... | +| `LEONIDA_MENU_PLAY` | see the code | | yes | | `leonida-gpu/host/menu.rs` +1 | ... the next start; "SAVE AND RESTART" starts play.ps1 again (`LEONIDA_MENU_PLAY`, with `LEONIDA_MENU_ARGS`) and ends this run.... | +| `LEONIDA_MENU_SMOOTH_MOTION` | see the code | | yes | | `leonida-gpu/host/menu.rs` +1 | | | `LEONIDA_MESH_OUTPUT_STRICT` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | Experiment (`LEONIDA_MESH_OUTPUT_STRICT=1`): they are refused. | | `LEONIDA_MESH_TEST` | see the code | | | | `leonida-gpu/draw.rs` | An experiment on mesh draws (`LEONIDA_MESH_TEST`): 1 for `skip` (none is issued), 2 for `scissor` (each runs its shaders but rasterises one pixel), 0 otherwise. | | `LEONIDA_MIN_LOD_KEPT` | on, `0` turns it off | yes | | | `leonida-gpu/tiles.rs` | `LEONIDA_MIN_LOD_KEPT=0`: reduced by as many levels as the view's start moved, as before (`LEONIDA_AB` can flip it for the views made from then on). | -| `LEONIDA_NAN_SCRUB` | see the code | | | | `leonida-gpu/host/menu.rs` +4 | `LEONIDA_NAN_SCRUB=1` (off by default): see `Lower::scrub_nan`. | +| `LEONIDA_NAN_SCRUB` | see the code | | yes | | `leonida-gpu/host/menu.rs` +4 | `LEONIDA_NAN_SCRUB=1` (off by default): see `Lower::scrub_nan`. | | `LEONIDA_NULL_SAMPLER_LINEAR` | see the code | | | | `leonida-gpu/descriptor/host.rs` +1 | LOCAL (11/26, `LEONIDA_NULL_SAMPLER_LINEAR=1`): a linear one instead. | | `LEONIDA_OPEN_ONE_VIEW` | on, `0` turns it off | yes | | | `leonida-gpu/watch.rs` | Whether a write fault opens the view that was written and leaves the page's other views read-only, not clean any more (`LEONIDA_OPEN_ONE_VIEW=0`: opens them all, as before). | -| `LEONIDA_OUTPUT` | see the code | | | | `leonida-gpu/aspect.rs` +2 | Neither makes the title draw a wider view: that is the title's output size (`LEONIDA_OUTPUT`, leonida-loader's `hooks.rs`, and `docs/ultrawide.md` for what is known of it). | +| `LEONIDA_OUTPUT` | see the code | | yes | | `leonida-gpu/aspect.rs` +2 | Neither makes the title draw a wider view: that is the title's output size (`LEONIDA_OUTPUT`, leonida-loader's `hooks.rs`, and `docs/ultrawide.md` for what is known of it). | | `LEONIDA_PAGE_ASK` | on, `0` turns it off | yes | | yes | `leonida-gpu/watch.rs` | Whether a fault asks Windows about its one page before it asks about the region around it (`LEONIDA_PAGE_ASK=0`: the region only, as before). | | `LEONIDA_PAGE_PARTS` | see the code | | | | `leonida-gpu/watch.rs` | Whether the parts of a page that the kernel names are kept, and a refresh copies those (`LEONIDA_PAGE_PARTS=0`: the 64 KiB page, as before). | | `LEONIDA_PAGE_WRITES` | see the code | | | | `leonida-gpu/descriptor/host.rs` +2 | What `LEONIDA_PAGE_WRITES` asks to be done with a write the guards do not see once its bytes are there ([`title_memory_written`]), as bits: 1, the guarded blocks under it are opened and count as written (host copies of b... | @@ -381,7 +374,7 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_PAIRED_LANES` | see the code | | | yes | `leonida-gpu/shader_cache.rs` +2 | `LEONIDA_PAIRED_LANES`: - unset or `1`: right before the wave-wide form, for any console wave64 compute program every earlier form refused (the 2-D tile groups of one console wave as well as 1-D groups with divergent cro... | | `LEONIDA_PAIRED_SHADER_DIR` | see the code | | | | `leonida-gpu/shader_cache.rs` | | | `LEONIDA_PANEL` | off unless set and not `0` | | | yes | `leonida-gpu/host/menu.rs` +3 | Diagnostics: the run's numbers on the picture (`LEONIDA_PANEL=1`; off by default; F3 shows and hides it while our window has the focus): white text on a black box in the upper left corner of what is shown, so that a scre... | -| `LEONIDA_PARTIAL_WRITTEN` | on, `0` turns it off | yes | | yes | `leonida-gpu/texture.rs` | `LEONIDA_PARTIAL_WRITTEN=0`: every 30th frame only, as before; `LEONIDA_AB` can turn it while the title runs). | +| `LEONIDA_PARTIAL_WRITTEN` | on, `0` turns it off | yes | | yes | `leonida-gpu/texture.rs` | Whether a write the guards see makes a partly mapped texture read again the next frame ([`partial_due`]; `LEONIDA_PARTIAL_WRITTEN=0`: every 30th frame only, as before; `LEONIDA_AB` can turn it while the title runs). | | `LEONIDA_PASSES_AHEAD` | see the code | yes | | | `leonida-gpu/draw.rs` +1 | ...f ours that is sent ahead of the frame's first submission (`LEONIDA_PASSES_AHEAD`: 1 or 0, or 2 for [`passes_ahead_where_sent`]; unset: with `LEONIDA_THIN=1`).... | | `LEONIDA_PENDING_FAST` | on, `0` turns it off | yes | | | `leonida-gpu/shadow.rs` | Whether a copy that no submission's shaders may be writing says so without the lock of its declared ranges (`LEONIDA_PENDING_FAST=0`: the lock is taken to find the list empty, as before). | | `LEONIDA_PICKED_MB` | see the code | | | | `leonida-gpu/picked.rs` | Bytes looked at in turn per frame (`LEONIDA_PICKED_MB`). | @@ -400,12 +393,12 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_PLACED_READERS` | on, `0` turns it off | yes | | | `leonida-gpu/host/place.rs` | Whether only the steps behind a copy at its place in a list count as its readers (on unless `LEONIDA_PLACED_READERS=0`: every step of the submission that reads its destination, wherever it stands, as before; `LEONIDA_AB`... | | `LEONIDA_PLACED_TITLE` | see the code | yes | yes | | `leonida-gpu/host.rs` +1 | ...ad its destination on the CPU do not wait for the flights (`LEONIDA_PLACED_TITLE=1`; off by default).... | | `LEONIDA_PLACED_UNDECLARED` | on, `0` turns it off | yes | | yes | `leonida-gpu/host.rs` | `LEONIDA_PLACED_UNDECLARED=0`: asked of every destination, as before. | -| `LEONIDA_PLACE_TAKEN` | see the code | | | | `leonida-gpu/memory.rs` | `LEONIDA_PLACE_TAKEN=0`: it counts as never taken, as before). | +| `LEONIDA_PLACE_TAKEN` | see the code | | | | `leonida-gpu/memory.rs` | Whether a page given its place at a submission ([`Memory::place`]) remembers the write-watch asking it was taken at (on; `LEONIDA_PLACE_TAKEN=0`: it counts as never taken, as before). | | `LEONIDA_POP_ALL` | see the code | | | | `leonida-gpu/popwatch.rs` | `LEONIDA_POP_FOLDER=<folder>`: the three pictures around a frame with blips (at most 200 times) are saved there, 640 wide; with `LEONIDA_POP_ALL=1` every frame's is. | | `LEONIDA_POP_FOLDER` | see the code | | | | `leonida-gpu/popwatch.rs` | `LEONIDA_POP_FOLDER=<folder>`: the three pictures around a frame with blips (at most 200 times) are saved there, 640 wide; with `LEONIDA_POP_ALL=1` every frame's is. | | `LEONIDA_POP_WATCH` | see the code | | | | `leonida-gpu/popwatch.rs` | `LEONIDA_POP_WATCH=<from>-<to>[,<from>-<to>..]` (seconds since the start): every presented frame in those times is read back, made small on a thread of its own and compared with its neighbours, block by block. | | `LEONIDA_PORT_CBV` | see the code | | | | `leonida-gpu/port_cbv.rs` +3 | Renderer port 5 (`LEONIDA_PORT_CBV=1`; off by default): constant buffers are read as raw bytes, a table's through the raw twin of its slot ([`raw_views`]), a root one as a root SRV, so the host can give the card the titl... | -| `LEONIDA_PORT_CBV_PLACE` | on, `0` turns it off | yes | | | `leonida-gpu/port_cbv.rs` | `LEONIDA_PORT_CBV_PLACE=0`: copied as before, and read through the raw twin all the same). | +| `LEONIDA_PORT_CBV_PLACE` | on, `0` turns it off | yes | | | `leonida-gpu/port_cbv.rs` | Whether a table's constant buffer in title memory in place is given to the card where it is (on with the port; `LEONIDA_PORT_CBV_PLACE=0`: copied as before, and read through the raw twin all the same). | | `LEONIDA_PORT_CONSTANTS` | see the code | | | yes | `leonida-gpu/draw.rs` +4 | Renderer port #1: the title's 32-bit graphics heap as the card's own memory (`LEONIDA_PORT_CONSTANTS`, off by default). | | `LEONIDA_PORT_CONSTANTS_ORDER` | on, `0` turns it off | yes | | | `leonida-gpu/draw.rs` | ...RT_CONSTANTS=1`) are clamped alone, right before they run (`LEONIDA_PORT_CONSTANTS_ORDER`; `=0`: in batches and windows as any other; it matters only with port 1 on).... | | `LEONIDA_PORT_DESCRIPTORS_CHECK` | see the code | | | | `leonida-gpu/port_descriptors.rs` | Pages the fallback looks at a frame (`LEONIDA_PORT_DESCRIPTORS_CHECK=<pages>`, 16 if not given; 0: none, and the write watch is not asked at all). | @@ -415,7 +408,7 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_PORT_JOURNAL` | see the code | yes | | yes | `leonida-gpu/port_journal.rs` +1 | Renderer port #7: the submitting lane's last waits (`LEONIDA_PORT_JOURNAL=1`, off by default; the switch is [`crate::watch::port_journal`]). | | `LEONIDA_PRELUDE_UPLOAD` | see the code | yes | | | `leonida-gpu/texture.rs` | ...sion once the check of the texture's memory is done there (`LEONIDA_PRELUDE_UPLOAD=0`: by the list itself, where it was recorded, as before).... | | `LEONIDA_PRESENT_10BIT` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_PRESENT_10BIT=0`: 8 bits, as before. | -| `LEONIDA_PRESENT_SCALE` | see the code | | | | `leonida-gpu/aspect.rs` +3 | Read by leonida-hle's `lifecycle.rs`, which widens the window the title asks for. - `LEONIDA_PRESENT_SCALE=fit\|stretch`: `fit` keeps the picture's shape in a window of another one, centred, with black bars beside it (or... | +| `LEONIDA_PRESENT_SCALE` | see the code | | yes | | `leonida-gpu/aspect.rs` +3 | Read by leonida-hle's `lifecycle.rs`, which widens the window the title asks for. - `LEONIDA_PRESENT_SCALE=fit\|stretch`: `fit` keeps the picture's shape in a window of another one, centred, with black bars beside it (or... | | `LEONIDA_PRESENT_SMOOTH` | see the code | yes | | yes | `leonida-gpu/host.rs` +1 | `LEONIDA_PRESENT_SMOOTH=<fraction>`: each host present is held until at least that fraction of the recent mean interval between presents has passed since the one before, so a quick frame after a slow one waits a little i... | | `LEONIDA_PROFILE` | see the code | | | yes | `leonida-gpu/copystat.rs` +1 | `LEONIDA_PROFILE=<from>,<to>,<ms>,<file>` samples the stacks of the busiest threads every `<ms>` milliseconds between two times (seconds, as `LEONIDA_STACKS`), and writes them counted to `<file>` at the end (several of t... | | `LEONIDA_QUEUE_MARKS` | off unless set and not `0` | yes | | yes | `leonida-gpu/descriptor/host.rs` | Off by default (`LEONIDA_QUEUE_MARKS=1`; `LEONIDA_AB` can name it): here no one waited for that lock, and by turns the submitting thread worked +0.27 and +0.06 ms a frame with the marks (runs d41). | @@ -423,25 +416,24 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_QUICK_FIND` | on, `0` turns it off | yes | | | `leonida-gpu/shadow.rs` | Whether [`FOUND`] is kept (`LEONIDA_QUICK_FIND=0`: not). | | `LEONIDA_QUICK_FIND_WINDOWS` | see the code | yes | yes | yes | `leonida-gpu/shadow.rs` +1 | Whether a thread also remembers what its asks for memory outside buffers found (`LEONIDA_QUICK_FIND_WINDOWS=1`; off by default, and only on the 4 MiB grid without tails: with finer windows the answer depends on the other... | | `LEONIDA_QUICK_MIRROR` | see the code | | | | `leonida-gpu/descriptor/host.rs` | Whether a slot already made from its record is told so without the lock (`LEONIDA_QUICK_MIRROR=0`: with it, as before). | -| `LEONIDA_RAW_VIEWS` | see the code | | | | `leonida-gpu/descriptor/host.rs` +1 | `LEONIDA_RAW_VIEWS=0`: they read the title's slots themselves, as before). | +| `LEONIDA_RAW_VIEWS` | see the code | | | | `leonida-gpu/descriptor/host.rs` +1 | ... they compute (`leonida_shader::emit::raw_views` says why; `LEONIDA_RAW_VIEWS=0`: they read the title's slots themselves, as before).... | | `LEONIDA_RAW_VIEW_CLAMP` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_RAW_VIEW_CLAMP=0` makes it from the range asked for, as before (what would have been cut is still counted). | | `LEONIDA_READY_ONCE` | on, `0` turns it off | yes | | | `leonida-gpu/draw.rs` | Whether a table a list reads again, with nothing changed in the list since, is left as it is (`LEONIDA_READY_ONCE=0`: every entry is gone through again at every draw). | | `LEONIDA_READ_BACK` | see the code | | | | `leonida-gpu/list.rs` | `LEONIDA_READ_BACK=0` leaves them unmade, as before. | | `LEONIDA_READ_BACK_POOL` | on, `0` turns it off | yes | | | `leonida-gpu/host.rs` | Whether a list's read-back buffers are kept, when the list is reset, for the next read backs of their sizes (`LEONIDA_READ_BACK_POOL=0`: each is made for its read back and let go with its list, as before; `LEONIDA_AB` ca... | -| `LEONIDA_READ_WATCH` | see the code | | | | `leonida-gpu/texback.rs` | ...ats float on; it read memory nothing had written (run rw1, `LEONIDA_READ_WATCH=1`: about 30 places in the title read those two kinds), and boats sank.... | | `LEONIDA_READ_ZERO_GAPS` | see the code | | | | `leonida-gpu/host.rs` | ...ite over all of a texture's bytes less at each read of it (`LEONIDA_READ_ZERO_GAPS=0`: the whole buffer first, as before).... | | `LEONIDA_REAPER` | see the code | yes | | | `leonida-gpu/host.rs` | Whether what the host is done with is let go of on a thread of its own ([`reaper`]; on by default, `LEONIDA_REAPER=0` turns it off; `LEONIDA_AB` can turn it on and off while the title runs). | | `LEONIDA_RECHECK_SOON` | see the code | | | | `leonida-gpu/draw.rs` | Whether a texture found changed with nothing to tell of it is looked at again in the next frame (`LEONIDA_RECHECK_SOON=0`: after four, as before). | | `LEONIDA_RECORD_ALWAYS` | see the code | | | | `leonida-gpu/replay/record.rs` | From `LEONIDA_RECORD`, `LEONIDA_RECORD_AT` (seconds, or `f<frame>`), `LEONIDA_RECORD_FRAMES` and `LEONIDA_RECORD_ALWAYS=1`. | | `LEONIDA_RECORD_AT` | see the code | | | | `leonida-gpu/replay/record.rs` | From `LEONIDA_RECORD`, `LEONIDA_RECORD_AT` (seconds, or `f<frame>`), `LEONIDA_RECORD_FRAMES` and `LEONIDA_RECORD_ALWAYS=1`. | | `LEONIDA_RECORD_FRAMES` | see the code | | | | `leonida-gpu/replay/record.rs` | From `LEONIDA_RECORD`, `LEONIDA_RECORD_AT` (seconds, or `f<frame>`), `LEONIDA_RECORD_FRAMES` and `LEONIDA_RECORD_ALWAYS=1`. | -| `LEONIDA_RECORD_THREADS_WIDE` | see the code | | | yes | `leonida-gpu/land.rs` | Threads of the pool for the heaps' records ([`each_view`]): as before, and with `LEONIDA_RECORD_THREADS_WIDE=1`. | +| `LEONIDA_RECORD_THREADS_WIDE` | see the code | yes | | yes | `leonida-gpu/land.rs` | Threads of the pool for the heaps' records ([`each_view`]): as before, and with `LEONIDA_RECORD_THREADS_WIDE=1`. | | `LEONIDA_REFLECT_MOST` | see the code | yes | yes | | `leonida-gpu/ambient.rs` +2 | Leonida: the brightest a reflection may be, as a multiple of the light around (`LEONIDA_REFLECT_MOST=<multiple>`; unset or 0: reflections as the title left them). | | `LEONIDA_REFRESH_AHEAD` | see the code | | | | `leonida-gpu/host.rs` | Whether the copies that a submission's shaders write are brought up to date together, on several threads, ahead of its steps (`LEONIDA_REFRESH_AHEAD=0`: each before the step that gives it to them). 580 copies a frame, on... | | `LEONIDA_REFRESH_CHECK` | see the code | | | | `leonida-gpu/host.rs` +1 | Diagnostic (`LEONIDA_REFRESH_CHECK=1`; off by default): after a refresh of `[from, to)` that trusted the write watch or the guards, the first 256 bytes of every 64 KiB block of it are read from title memory and compared... | | `LEONIDA_REFRESH_DIRTY` | on, `0` turns it off | yes | | | `leonida-gpu/shadow.rs` | ...ss, and the lists of a card side read without their locks (`LEONIDA_REFRESH_DIRTY=0`: every page of the range looked at one by one, as before).... | | `LEONIDA_REFRESH_FRONT` | off unless set and not `0` | | | | `leonida-gpu/host.rs` | Whether everything a submission refreshes is brought up to date in one go, on several threads, ahead of its steps (`LEONIDA_REFRESH_FRONT=1`, and with `LEONIDA_JOIN_PARTS`, which needs it; else in groups where the steps... | -| `LEONIDA_RELAY_COPY` | see the code | | | | `leonida-gpu/host.rs` +5 | Whether the pieces the relay fetches from the card's memory come over the card's copy queue (`LEONIDA_RELAY_COPY=1`) and not over the queue that draws. | +| `LEONIDA_RELAY_COPY` | see the code | | yes | | `leonida-gpu/host.rs` +5 | Whether the pieces the relay fetches from the card's memory come over the card's copy queue (`LEONIDA_RELAY_COPY=1`) and not over the queue that draws. | | `LEONIDA_RELAY_CROSS` | see the code | | | | `leonida-gpu/host/upcheck.rs` | LOCAL (11/26, `LEONIDA_RELAY_CROSS=1`): whether a refresh of `runs` reads title memory that a flight in the air may be writing through another copy of it ([`reads`] counts those). | | `LEONIDA_RELOOK_MS` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_RELOOK_MS` (20,000 unless said; 4,000 before): at 4,000 the opening cutscene's 4 frames a second looked at its ~20,000 slots waiting for their memory every 16 frames, thousands of queries a second and most of th... | | `LEONIDA_REMAP_BOOST` | on, `0` turns it off | yes | | | `leonida-gpu/watch.rs` | Whether the thread that changes a mapping runs at the highest priority while it holds title memory still (`LEONIDA_REMAP_BOOST=0`: at its own). | @@ -455,31 +447,31 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_ROOT_DEDUPE` | on, `0` turns it off | yes | | | `leonida-gpu/pipeline/host.rs` | `LEONIDA_ROOT_DEDUPE=0`: one object per pipeline, as before. | | `LEONIDA_ROOT_SRV_DIRECT` | see the code | | | | `leonida-gpu/draw.rs` +1 | `LEONIDA_ROOT_SRV_DIRECT=1` goes back to root descriptors. | | `LEONIDA_ROOT_UAV_MB` | see the code | | | | `leonida-gpu/draw.rs` | False if the draw must be dropped. shortcut: a root view has no size: the view, the refresh and the copy back cover all that is left of the title's buffer (`LEONIDA_ROOT_UAV_MB` sets a limit for all three). | -| `LEONIDA_ROOT_VIEW_MB` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_ROOT_VIEW_MB` sets a limit again.) | -| `LEONIDA_RT_RESOLVE` | see the code | | | | `leonida-gpu/pipeline/make.rs` +1 | Without BVH, ~1,000 CS_RaytracingResolve shaders shade no hits while clogging the cold compiler queue; skip unless LEONIDA_RT_RESOLVE=1. | +| `LEONIDA_ROOT_VIEW_MB` | see the code | | | | `leonida-gpu/draw.rs` | ...ht up to date - meshes without bodies, exploded triangles. `LEONIDA_ROOT_VIEW_MB` sets a limit again.)... | +| `LEONIDA_RT_RESOLVE` | see the code | | yes | | `leonida-gpu/pipeline/make.rs` +1 | Without BVH, ~1,000 CS_RaytracingResolve shaders shade no hits while clogging the cold compiler queue; skip unless LEONIDA_RT_RESOLVE=1. | | `LEONIDA_SAFE_COPY` | see the code | | | | `leonida-gpu/host.rs` +1 | `LEONIDA_SAFE_COPY=0`: through the kernel, as before. | | `LEONIDA_SAME_RECORDS` | on, `0` turns it off | yes | | | `leonida-gpu/titlewrite.rs` | ...py of its own, but what is there already is never written (`LEONIDA_SAME_RECORDS=0`: always). # Safety `[from, from + n)` and `[to, to + n)` are the title's.... | -| `LEONIDA_SAMPLERS_AGAIN` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor.rs` | `LEONIDA_SAMPLERS_AGAIN=0`: not). | +| `LEONIDA_SAMPLERS_AGAIN` | on, `0` turns it off | yes | | | `leonida-gpu/descriptor.rs` | Leonida: a sampler heap is looked through whole every so often, for a record the calls and the written pages both missed (`HostHeap::samplers_again`; `LEONIDA_SAMPLERS_AGAIN=0`: not). | | `LEONIDA_SAMPLE_MASK` | see the code | | | | `leonida-gpu/list.rs` +1 | `LEONIDA_SAMPLE_MASK=0`: ignored, as before. | | `LEONIDA_SCISSOR_TEST` | see the code | | | | `leonida-gpu/draw.rs` | An experiment on the title's scissor rectangles (`LEONIDA_SCISSOR_TEST=full`): they are all widened to the whole target. | -| `LEONIDA_SCRATCH_CARD` | see the code | | | yes | `leonida-gpu/host.rs` | ... card's memory, at most [`SPARE_CARD_MOST`] of them idle), `LEONIDA_SCRATCH_CARD=1` or `0` either way, `LEONIDA_AB` by turns.... | +| `LEONIDA_SCRATCH_CARD` | see the code | yes | | yes | `leonida-gpu/host.rs` | ... card's memory, at most [`SPARE_CARD_MOST`] of them idle), `LEONIDA_SCRATCH_CARD=1` or `0` either way, `LEONIDA_AB` by turns.... | | `LEONIDA_SCRATCH_POOL` | see the code | | | | `leonida-gpu/host.rs` +1 | `LEONIDA_SCRATCH_POOL=0`: chunks of 4 MiB kept by their list, as before. | | `LEONIDA_SCREEN_WAIT_MS` | see the code | | | | `leonida-gpu/pipeline/make.rs` | As [`wait_budget`], for passes over the screen (`LEONIDA_SCREEN_WAIT_MS`, 10 s; 0: like the others). | | `LEONIDA_SECTION_MB` | see the code | | yes | yes | `leonida-gpu/inplace.rs` +2 | `LEONIDA_SECTION_MB=<MiB>` makes an allocation of sections of that many MiB at most (unset, 0 or not a number: all its pages in one section, as before). | | `LEONIDA_SEND_BAR` | see the code | | | | `leonida-gpu/host/send.rs` | Whether the memory lies in the card's memory, written by the CPU through the bus (`LEONIDA_SEND_BAR=1`): the copies on the card's drawing queue, which nothing overlaps, then cross no bus. | | `LEONIDA_SEND_CHANGED` | see the code | | | | `leonida-gpu/host.rs` +1 | Whether a refresh of a copy in the card's memory takes, and sends up, the dwords that title memory changed and no others (`LEONIDA_SEND_CHANGED=1`; off: the 64 KiB pages written since it last took them, whole). | | `LEONIDA_SEND_OWN` | see the code | | | | `leonida-gpu/host/send.rs` | What goes up to copies in the card's memory goes up as it was when its submission was prepared (`LEONIDA_SEND_OWN`, on by default; `0`: as before). | -| `LEONIDA_SEND_TAKE_BESIDE` | see the code | yes | | yes | `leonida-gpu/host.rs` +1 | `LEONIDA_SEND_TAKE_BESIDE=0`: waited for in `take`, as before; `check`: the bytes are compared with where they came from when they are waited for, which reads upload memory and is slow; `LEONIDA_AB` can name it). | +| `LEONIDA_SEND_TAKE_BESIDE` | see the code | yes | | yes | `leonida-gpu/host.rs` +1 | ...re waited for before that list is closed ([`Own::settle`]; `LEONIDA_SEND_TAKE_BESIDE=0`: waited for in `take`, as before; `check`: the bytes are compared with where they came from when they are waited for, which reads up... | | `LEONIDA_SHADER_SAVE` | see the code | | | | `leonida-gpu/pipeline.rs` +1 | `LEONIDA_SHADER_SAVE=<dir>`: each shader as the title gave it (`.cdxil`) and as translated (`.dxil`), by the hash crash reports name it with | | `LEONIDA_SHARPEN` | see the code | | | | `leonida-gpu/compose.rs` | Leonida: the scene sharpened before the interface goes over it (SHARPEN, 0 to 1, set when the pass is made from LEONIDA_SHARPEN). | | `LEONIDA_SHOW_AFTER` | see the code | | yes | yes | `leonida-gpu/descriptor/host.rs` +4 | Whether a title slot shows a texture that is new to it only once the submission with its upload has finished (`LEONIDA_SHOW_AFTER=1`; off). | | `LEONIDA_SHOW_NEW_LATER` | see the code | yes | | | `leonida-gpu/descriptor/host.rs` | ...e it may still run shows it only once those have finished (`LEONIDA_SHOW_NEW_LATER`, on; 0: at once, as before; A/B-able). [`show_after`] left out slots made "at once" from a draw's table, the texture pass's paths that a... | | `LEONIDA_SKIP_KEPT` | see the code | | | | `leonida-gpu/pipeline.rs` | `LEONIDA_SKIP_KEPT=0`: looked up each time, as before. | -| `LEONIDA_SKIP_PIPELINES` | see the code | | | | `leonida-gpu/drops.rs` +3 | Timing experiment: the pipelines with a shader that `LEONIDA_SKIP_TRY_A`, `_B` or `_C` names (hashes, as for `LEONIDA_SKIP_PIPELINES`) are left out while that switch is on. | +| `LEONIDA_SKIP_PIPELINES` | see the code | | yes | | `leonida-gpu/drops.rs` +3 | Timing experiment: the pipelines with a shader that `LEONIDA_SKIP_TRY_A`, `_B` or `_C` names (hashes, as for `LEONIDA_SKIP_PIPELINES`) are left out while that switch is on. | | `LEONIDA_SKIP_RT_SHADOW` | see the code | | | | `leonida-gpu/pipeline/make.rs` | Whether the traced shadow passes ([`RT_SHADOW_NAMES`]) are left out (`LEONIDA_SKIP_RT_SHADOW=1`; off by default: they run, as before). | -| `LEONIDA_SKIP_TRY_A` | see the code | | | yes | `leonida-gpu/pipeline.rs` | Timing experiment: the pipelines with a shader that `LEONIDA_SKIP_TRY_A`, `_B` or `_C` names (hashes, as for `LEONIDA_SKIP_PIPELINES`) are left out while that switch is on. | -| `LEONIDA_SKIP_TRY_B` | see the code | | | | `leonida-gpu/pipeline.rs` | Each is a switch of `LEONIDA_AB` (`LEONIDA_AB=15,LEONIDA_SKIP_TRY_A,LEONIDA_SKIP_TRY_B`) and does nothing when it is not named there: a phase's frame time against the next one's says what those programs cost the card in... | -| `LEONIDA_SKIP_TRY_C` | see the code | | | | `leonida-gpu/pipeline.rs` | | +| `LEONIDA_SKIP_TRY_A` | see the code | yes | | yes | `leonida-gpu/pipeline.rs` | Timing experiment: the pipelines with a shader that `LEONIDA_SKIP_TRY_A`, `_B` or `_C` names (hashes, as for `LEONIDA_SKIP_PIPELINES`) are left out while that switch is on. | +| `LEONIDA_SKIP_TRY_B` | see the code | yes | | | `leonida-gpu/pipeline.rs` | Each is a switch of `LEONIDA_AB` (`LEONIDA_AB=15,LEONIDA_SKIP_TRY_A,LEONIDA_SKIP_TRY_B`) and does nothing when it is not named there: a phase's frame time against the next one's says what those programs cost the card in... | +| `LEONIDA_SKIP_TRY_C` | see the code | yes | | | `leonida-gpu/pipeline.rs` | | | `LEONIDA_SLOT_CHECK` | see the code | | | | `leonida-gpu/book.rs` | ...every slot of the view heap whose descriptor reaches it. - `LEONIDA_SLOT_CHECK=1`: a thread walks the view heap and says which slots name memory that is gone, while nothing is lost yet ([`check`]).... | | `LEONIDA_SLOT_HOLDS` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_SLOT_HOLDS=0`: only the list holds it, as before. | | `LEONIDA_SLOT_SETTLE` | on, `0` turns it off | yes | | | `leonida-gpu/host.rs` | `LEONIDA_SLOT_SETTLE=0`: refused without the wait. | @@ -487,12 +479,12 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_SNAPSHOT_POOL` | see the code | | | | `leonida-gpu/shadow.rs` | How many snapshot buffers are kept (`LEONIDA_SNAPSHOT_POOL`; `8`: as before). | | `LEONIDA_SPANS_QUICK` | off unless set and not `0` | yes | | yes | `leonida-gpu/descriptor/host.rs` | Off by default (`LEONIDA_SPANS_QUICK=1`; `LEONIDA_AB` can name it): here the lock was not waited for, and in four runs by turns the submitting thread worked 0.12 to 0.30 ms a frame more with it (runs d41, d43; `docs/find... | | `LEONIDA_SPLIT_WAITS` | see the code | | | | `leonida-gpu/queue.rs` | `LEONIDA_SPLIT_WAITS=0` holds whole submissions, as before. | -| `LEONIDA_STALE_TEXTURES` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_STALE_TEXTURES=overlap`. | +| `LEONIDA_STALE_TEXTURES` | see the code | | | | `leonida-gpu/descriptor/host.rs` | ...s neighbours out of the queue and off the card, for good). `LEONIDA_STALE_TEXTURES=overlap`.... | | `LEONIDA_STATE_CACHE` | on, `0` turns it off | yes | | | `leonida-gpu/copystat.rs` +1 | What a host list was last given for its root parameters and its vertex and index buffers, so that a draw that sets the same value again records nothing (`LEONIDA_STATE_CACHE=0`: every call is recorded, as before). | | `LEONIDA_STATIC_SAMPLERS_LINEAR` | see the code | | yes | yes | `leonida-gpu/pipeline/host.rs` +1 | `LEONIDA_STATIC_SAMPLERS_LINEAR`: immediate samplers of the title's shaders filter linearly in minification, magnification and mips (anisotropic ones keep their filter; the reduction and comparison bits stay, so a point... | | `LEONIDA_STEP_GATHER` | off unless set and not `0` | yes | | | `leonida-gpu/host/card_steps.rs` | Whether a level's reads go into the buffer between by one dispatch for each host copy read, not by a copy command each (`LEONIDA_STEP_GATHER=1`; off by default; `LEONIDA_AB` can name it). | -| `LEONIDA_STORE_BESIDE` | see the code | | yes | yes | `leonida-gpu/titlewrite.rs` +1 | ...hat faults is done here, and the thread goes on behind it (`LEONIDA_STORE_BESIDE=1`; off unless asked for).... | -| `LEONIDA_STREAMLINE_DIR` | see the code | | | | `leonida-gpu/dlss.rs` +2 | `LEONIDA_FRAME_GEN=2\|3\|4` (frames shown per rendered one; unset or 1: off) with the SDK's signed DLLs in `LEONIDA_STREAMLINE_DIR` (sl.interposer, sl.common, sl.dlss_g, sl.reflex, sl.pcl, nvngx_dlssg). | +| `LEONIDA_STORE_BESIDE` | see the code | yes | yes | yes | `leonida-gpu/titlewrite.rs` +1 | ...hat faults is done here, and the thread goes on behind it (`LEONIDA_STORE_BESIDE=1`; off unless asked for).... | +| `LEONIDA_STREAMLINE_DIR` | see the code | | yes | | `leonida-gpu/dlss.rs` +2 | `LEONIDA_FRAME_GEN=2\|3\|4` (frames shown per rendered one; unset or 1: off) with the SDK's signed DLLs in `LEONIDA_STREAMLINE_DIR` (sl.interposer, sl.common, sl.dlss_g, sl.reflex, sl.pcl, nvngx_dlssg). | | `LEONIDA_STRICT_JOINS` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | ...lue, was zero in every lane that way). shortcut: only with `LEONIDA_STRICT_JOINS` set (the offline pack listing sets it to count them): 40 programs that translate today stop by name with it (vehicle paint pixel shaders a... | | `LEONIDA_STRUCTURED_BYTES` | see the code | | | | `leonida-gpu/descriptor/host.rs` | Off unless `LEONIDA_STRUCTURED_BYTES=1`: it leaves such a view structured on its buffer's copy, as before. | | `LEONIDA_SUBMIT_DEPTH` | see the code | | | | `leonida-gpu/queue/behind.rs` | How many submissions may be in the line when a submit call returns (`LEONIDA_SUBMIT_DEPTH`; 64: about two frames of the title's). | @@ -513,19 +505,19 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_TEXTURE_BUDGET_MB` | see the code | | | | `leonida-gpu/resource.rs` | The limit `LEONIDA_TEXTURE_BUDGET_MB` sets on the bytes of host copies of the title's textures, if it is set. | | `LEONIDA_TEXTURE_CATCHUP` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_TEXTURE_CATCHUP=0` keeps the plain budget. | | `LEONIDA_TEXTURE_COPY` | see the code | | | | `leonida-gpu/texture.rs` | Whether a texture all of whose memory is mapped is read through the kernel's copy instead of in place (`LEONIDA_TEXTURE_COPY=1`; off by default). | -| `LEONIDA_TEXTURE_FAVOR_REUSED` | off unless set and not `0` | yes | | | `leonida-gpu/resource.rs` | `LEONIDA_TEXTURE_FAVOR_REUSED=1`; off by default; `LEONIDA_AB` can name it). | +| `LEONIDA_TEXTURE_FAVOR_REUSED` | off unless set and not `0` | yes | | | `leonida-gpu/resource.rs` | ...idle ([`let_go_idle`], where the card's room sets a limit; `LEONIDA_TEXTURE_FAVOR_REUSED=1`; off by default; `LEONIDA_AB` can name it).... | | `LEONIDA_TEXTURE_FILL` | see the code | | | | `leonida-gpu/texture.rs` | Whether a refresh that does not wait ([`no_wait`]) and finds a page missing fills a staging buffer that was never filled from the pages that are there (`LEONIDA_TEXTURE_FILL=0`: it was left as it was made). | | `LEONIDA_TEXTURE_GUARD` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_TEXTURE_GUARD=0` hashes at every check, as before. | | `LEONIDA_TEXTURE_HASH_BACKOFF` | off unless set and not `0` | yes | yes | yes | `leonida-gpu/texture.rs` +1 | ...s, takes only one of every [`backoff_every`] of its turns (`LEONIDA_TEXTURE_HASH_BACKOFF`, off unless asked; `LEONIDA_AB` can turn it while the title runs).... | -| `LEONIDA_TEXTURE_HASH_BACKOFF_AFTER` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_TEXTURE_HASH_BACKOFF_AFTER`, 4). | -| `LEONIDA_TEXTURE_HASH_BACKOFF_N` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_TEXTURE_HASH_BACKOFF_N`, 16). | +| `LEONIDA_TEXTURE_HASH_BACKOFF_AFTER` | see the code | | | | `leonida-gpu/texture.rs` | Looks in a row that found a texture as it was before it backs off ([`hash_backoff`]; `LEONIDA_TEXTURE_HASH_BACKOFF_AFTER`, 4). | +| `LEONIDA_TEXTURE_HASH_BACKOFF_N` | see the code | | | | `leonida-gpu/texture.rs` | One turn in this many for a quiet texture ([`hash_backoff`]; `LEONIDA_TEXTURE_HASH_BACKOFF_N`, 16). | | `LEONIDA_TEXTURE_HOT` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_TEXTURE_HOT=0`: every eighth frame only, as before. | | `LEONIDA_TEXTURE_KEEP` | see the code | | | | `leonida-gpu/host.rs` +1 | `LEONIDA_TEXTURE_KEEP=0`: [`vram_idle_ms`]' older rule, all that are idle; `=1`: that rule with its two longer times. | | `LEONIDA_TEXTURE_NO_WAIT` | see the code | | yes | | `leonida-gpu/host/menu.rs` +3 | Whether a texture refresh that finds the runtime remapping title memory goes on without waiting for it (`LEONIDA_TEXTURE_NO_WAIT=1`; off by default). | | `LEONIDA_TEXTURE_ONCE` | see the code | | | | `leonida-gpu/texture.rs` | Whether a staging buffer made for one upload of a texture picked by index is filled without asking the write watch and the guards (`LEONIDA_TEXTURE_ONCE=0`: with, as before). | | `LEONIDA_TEXTURE_POOL` | see the code | | | | `leonida-gpu/pool.rs` | `LEONIDA_TEXTURE_POOL=0` makes every one an allocation of its own again. | -| `LEONIDA_TEXTURE_ROOM_PERCENT` | see the code | | | | `leonida-gpu/resource.rs` +1 | The share of the card's budget, in percent, up to which host copies of textures picked by index are made ([`room`]): 90 unless `LEONIDA_TEXTURE_ROOM_PERCENT` says another (50 to 97). | -| `LEONIDA_TEXTURE_SAME` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_TEXTURE_SAME=0`: not asked. | +| `LEONIDA_TEXTURE_ROOM_PERCENT` | see the code | | yes | | `leonida-gpu/resource.rs` +1 | The share of the card's budget, in percent, up to which host copies of textures picked by index are made ([`room`]): 90 unless `LEONIDA_TEXTURE_ROOM_PERCENT` says another (50 to 97). | +| `LEONIDA_TEXTURE_SAME` | see the code | | | | `leonida-gpu/texture.rs` | (Of 787 repeated uploads of a frame that streams 398 were equal in every byte, and a texture uploaded again costs a staging buffer, a detiling and a copy more than this look.) `LEONIDA_TEXTURE_SAME=0`: not asked. | | `LEONIDA_TEXTURE_STAGE_MB` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_TEXTURE_STAGE_MB` sets it: a backlog of tens of thousands of textures (a scene's first minutes) then drains in fewer frames. | | `LEONIDA_TEXTURE_STAGE_MS` | see the code | | | | `leonida-gpu/draw.rs` | | | `LEONIDA_TEXTURE_SWEEP` | see the code | | | | `leonida-gpu/resource.rs` | `LEONIDA_TEXTURE_SWEEP=0` lets nothing go. | @@ -535,11 +527,10 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_THIN_THREADS` | see the code | | yes | yes | `leonida-gpu/list/thin.rs` +1 | | | `LEONIDA_THREAD_DIMENSIONS` | see the code | | | | `leonida-gpu/draw.rs` | `LEONIDA_THREAD_DIMENSIONS=0`: such counts are taken for groups, as before. | | `LEONIDA_THREAD_TICKET` | see the code | | | | `leonida-gpu/shader_cache.rs` +2 | `LEONIDA_THREAD_TICKET=0`: the flat id of the wave's first lane rounded down, as before. | -| `LEONIDA_TILES_TEST_CARD` | see the code | | | | `leonida-gpu/tiles.rs` | `cargo test -p leonida-gpu --release -- --ignored levels_on_demand --nocapture` It runs on the SOFTWARE adapter unless `LEONIDA_TILES_TEST_CARD=1`: on that adapter nothing reaches the card or its driver, so nothing it do... | | `LEONIDA_TIMELINE` | see the code | | | yes | `leonida-gpu/timeline.rs` +2 | `LEONIDA_TIMELINE=<file>` writes one, from the first present after `LEONIDA_TIMELINE_AT` seconds (60) on and for `LEONIDA_TIMELINE_FRAMES` frames (3); `LEONIDA_TIMELINE=<from s>[+<from s>..],<frames>,<file>` one for each... | | `LEONIDA_TIMELINE_AT` | see the code | | | | `leonida-gpu/timeline.rs` +1 | `LEONIDA_TIMELINE=<file>` writes one, from the first present after `LEONIDA_TIMELINE_AT` seconds (60) on and for `LEONIDA_TIMELINE_FRAMES` frames (3); `LEONIDA_TIMELINE=<from s>[+<from s>..],<frames>,<file>` one for each... | | `LEONIDA_TIMELINE_FRAMES` | see the code | | | | `leonida-gpu/timeline.rs` +1 | `LEONIDA_TIMELINE=<file>` writes one, from the first present after `LEONIDA_TIMELINE_AT` seconds (60) on and for `LEONIDA_TIMELINE_FRAMES` frames (3); `LEONIDA_TIMELINE=<from s>[+<from s>..],<frames>,<file>` one for each... | -| `LEONIDA_TITLE_PRIORITIES` | see the code | | | | `leonida-gpu/host/menu.rs` +3 | `LEONIDA_TITLE_PRIORITIES=0`: as the title sets them. | +| `LEONIDA_TITLE_PRIORITIES` | see the code | | yes | | `leonida-gpu/host/menu.rs` +3 | `LEONIDA_TITLE_PRIORITIES=0`: as the title sets them. | | `LEONIDA_TRAIL` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_TRAIL=0`: nothing is kept and nothing is said. | | `LEONIDA_TRANSLATOR` | see the code | | | | `leonida-gpu/shader_cache.rs` | | | `LEONIDA_TWIN_BIAS` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_TWIN_BIAS=0`: null, as before (programs then add a bias of 0). | @@ -550,12 +541,12 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_UNIFORM_LOADS` | see the code | | | yes | `leonida-gpu/shader_cache.rs` +1 | Whether buffer loads of read-only views at an address the lanes hold alike count as the same in every lane (`LEONIDA_UNIFORM_LOADS`, on unless `0`): a first-lane read of such a value then needs nothing from the other hos... | | `LEONIDA_UNWATCHED_FRAMES` | see the code | | | | `leonida-gpu/draw.rs` | | | `LEONIDA_UPCOPY_CHECK` | see the code | | | | `leonida-gpu/host/upcheck.rs` | Diagnostics (`LEONIDA_UPCOPY_CHECK=1`; off by default): whether what goes up to a copy in the card's memory is older than what the card holds. | -| `LEONIDA_UPLOAD_AHEAD` | see the code | yes | | | `leonida-gpu/draw.rs` +5 | First uploads of textures picked by index on a copy queue of their own (`LEONIDA_UPLOAD_AHEAD`): read, detiled and copied by threads of ours as soon as the texture pass has made them, and the slots that wait for them sho... | -| `LEONIDA_UPLOAD_GUARD` | on, `0` turns it off | yes | | yes | `leonida-gpu/texture.rs` | `LEONIDA_UPLOAD_GUARD=0`: made, as before; `LEONIDA_AB` can turn it while the title runs, the writes are noted either way). | +| `LEONIDA_UPLOAD_AHEAD` | see the code | yes | yes | | `leonida-gpu/draw.rs` +5 | First uploads of textures picked by index on a copy queue of their own (`LEONIDA_UPLOAD_AHEAD`): read, detiled and copied by threads of ours as soon as the texture pass has made them, and the slots that wait for them sho... | +| `LEONIDA_UPLOAD_GUARD` | on, `0` turns it off | yes | | yes | `leonida-gpu/texture.rs` | ...efore it ([`PreludeUpload::claim`], [`host_write_listed`]; `LEONIDA_UPLOAD_GUARD=0`: made, as before; `LEONIDA_AB` can turn it while the title runs, the writes are noted either way).... | | `LEONIDA_UPLOAD_LOW` | see the code | | | | `leonida-gpu/upload.rs` | `LEONIDA_UPLOAD_LOW=0`: from the process heap, as before. | | `LEONIDA_UPSCALE_PROBE` | see the code | | | yes | `leonida-gpu/list.rs` +1 | `LEONIDA_UPSCALE_PROBE=1`: logs what the title gives each upscale (the inputs a temporal upscaler such as DLSS or FSR 2 needs), now and then. | | `LEONIDA_VIDEO_HOT_FRAMES` | see the code | | | | `leonida-gpu/texture.rs` | LOCAL (wt5 build38, bodnjenie14 12457b43 "Bink video flickering"): after the hash finds a change the guard did not see, the texture stays hot this many frames (`LEONIDA_VIDEO_HOT_FRAMES`, 1,024 unless said; 64 before). | -| `LEONIDA_VIDEO_PLANES` | see the code | | | | `leonida-gpu/texture.rs` | `LEONIDA_VIDEO_PLANES=0`: as before. | +| `LEONIDA_VIDEO_PLANES` | see the code | | | | `leonida-gpu/texture.rs` | Those are hashed at every check. `LEONIDA_VIDEO_PLANES=0`: as before. | | `LEONIDA_VIEW_BYTES` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_VIEW_BYTES=0` leaves them null, as before. | | `LEONIDA_VIEW_CACHE` | off unless set and not `0` | yes | | yes | `leonida-gpu/descriptor.rs` | Off unless `LEONIDA_VIEW_CACHE=1`; by turns under A/B. | | `LEONIDA_VIEW_COPY` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_VIEW_COPY=0`: made in place, as before. | @@ -563,12 +554,12 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_VIEW_GUARD` | see the code | | | | `leonida-gpu/watch.rs` | `LEONIDA_VIEW_GUARD=0`: each address for itself, as before. | | `LEONIDA_VIEW_INLINE` | see the code | | | | `leonida-gpu/descriptor.rs` | `LEONIDA_VIEW_INLINE=0`: every view is an entry, as before. | | `LEONIDA_VIEW_THREADS` | see the code | | | | `leonida-gpu/land.rs` | Calls `f` with every number below `count`, on this thread and on threads kept for making descriptors (`LEONIDA_VIEW_THREADS`, 4 with this one, 6 for records; 1: on this one alone). | -| `LEONIDA_VIEW_THREADS_WIDE` | see the code | | | yes | `leonida-gpu/land.rs` | Threads of the pool for the views picked by index ([`each_view`]): as before, and with `LEONIDA_VIEW_THREADS_WIDE=1`. | +| `LEONIDA_VIEW_THREADS_WIDE` | see the code | yes | | yes | `leonida-gpu/land.rs` | Threads of the pool for the views picked by index ([`each_view`]): as before, and with `LEONIDA_VIEW_THREADS_WIDE=1`. | | `LEONIDA_VIPATCH_NO_VIGNETTE` | see the code | | | | `leonida-gpu/host/menu.rs` +1 | | -| `LEONIDA_VOLUME_VIEWS` | see the code | | | | `leonida-gpu/descriptor/host.rs` | `LEONIDA_VOLUME_VIEWS=0`: not. | +| `LEONIDA_VOLUME_VIEWS` | see the code | | | | `leonida-gpu/descriptor/host.rs` | ...ead as a volume, levels that are not there), this says so. `LEONIDA_VOLUME_VIEWS=0`: not.... | | `LEONIDA_WAIT_ASK` | see the code | | | | `leonida-gpu/list.rs` | `LEONIDA_WAIT_ASK=1` asks first, as before. | | `LEONIDA_WAIT_FORCE` | see the code | | | | `leonida-gpu/queue.rs` | `LEONIDA_WAIT_FORCE=0` keeps it held: for finding out whether the title's waits reach across its presents; a wait nothing ever meets then stops the title for good. | -| `LEONIDA_WAIT_RESIDENT` | see the code | | | | `leonida-gpu/host.rs` | `LEONIDA_WAIT_RESIDENT=0`: as before). | +| `LEONIDA_WAIT_RESIDENT` | see the code | | | | `leonida-gpu/host.rs` | Whether new memory is made resident, and waited for, before anything can name it (on by default; `LEONIDA_WAIT_RESIDENT=0`: as before). | | `LEONIDA_WALLS_TRACE` | see the code | | | | `leonida-gpu/host.rs` +1 | The walls trace (`LEONIDA_WALLS_TRACE=1` or `2`; off by default): log lines that say what the title's CPU was given while it decided whether the camera is in a room. | | `LEONIDA_WAVE_DEEP_SKIPS` | see the code | | | | `leonida-gpu/shader_cache.rs` +1 | (`LEONIDA_WAVE_DEEP_SKIPS=0` and `LEONIDA_WAVE_WIDE=0` turn the two off.) | | `LEONIDA_WAVE_LDS_LOOSE` | see the code | | | yes | `leonida-gpu/shader_cache.rs` +1 | Leonida, last of all, only with `LEONIDA_WAVE_LDS_LOOSE=1`: LDS read and written inside one lane-branch region, the host waves meeting only around it (`lower::with_lds_loose`, approximate). | @@ -586,7 +577,7 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_WIDE_SPIN` | see the code | | | | `leonida-gpu/shadow.rs` +1 | Waits awake until `there` says so, `LEONIDA_WIDE_SPIN` microseconds at most (0, the default: not at all): asleep, a thread is woken in 50 us and more, 95 times a frame. | | `LEONIDA_WIDE_TEXTURES` | see the code | | | | `leonida-gpu/host.rs` | Whether a submission's textures are brought up to date on several threads (`LEONIDA_WIDE_TEXTURES=0`: one after the other, where the lists name them, as before). | | `LEONIDA_WIDE_THREADS` | see the code | | | | `leonida-gpu/shadow.rs` | `LEONIDA_WIDE_THREADS=<n>`: that many helper threads, whatever the PC has. | -| `LEONIDA_WINDOWS_BAR_MB` | see the code | | | yes | `leonida-gpu/shadow.rs` +1 | The most bytes of windows outside buffers that lie in the card's memory and are filled by the CPU through the bus (`LEONIDA_WINDOWS_BAR_MB`; 0, the default, none): one buffer (`D3D12_HEAP_TYPE_GPU_UPLOAD`), no CPU's side... | +| `LEONIDA_WINDOWS_BAR_MB` | see the code | | yes | yes | `leonida-gpu/shadow.rs` +1 | The most bytes of windows outside buffers that lie in the card's memory and are filled by the CPU through the bus (`LEONIDA_WINDOWS_BAR_MB`; 0, the default, none): one buffer (`D3D12_HEAP_TYPE_GPU_UPLOAD`), no CPU's side... | | `LEONIDA_WINDOWS_OWN` | see the code | | | | `leonida-gpu/shadow.rs` | Whether windows outside buffers have two sides too, so that submissions in the air read the bytes they were prepared with (`LEONIDA_WINDOWS_OWN=1`; off by default: it takes the windows' bytes again, 3.3 GB in capture rep... | | `LEONIDA_WINDOW_KB` | see the code | | | | `leonida-gpu/shadow.rs` | The grid the windows of asks with a length are cut on, in bytes: 4 MiB unless `LEONIDA_WINDOW_KB` names a smaller power of two (64 at least). | | `LEONIDA_WINDOW_TAILS` | see the code | | | | `leonida-gpu/shadow.rs` | ... goes when nothing holds it any more. shortcut: off unless `LEONIDA_WINDOW_TAILS=1`.... | @@ -597,12 +588,12 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | Name | Kind | A/B | L | F | Named in | In the code's words | |---|---|---|---|---|---|---| -| `LEONIDA_ALIAS_CHUNK` | off unless set and not `0` | | | | `leonida-hle/modules/xmem.rs` | `LEONIDA_ALIAS_CHUNK=<pages>`, 16 unless set; 0: the whole range at once, as before. | -| `LEONIDA_ALIAS_SAME` | off unless set and not `0` | | | | `leonida-hle/modules/xmem.rs` | Whether [`map_alias`] leaves a page mapped that shows the page it is to show already (`LEONIDA_ALIAS_SAME=0`: unmapped and mapped again, as before). | +| `LEONIDA_ALIAS_CHUNK` | see the code | yes | | | `leonida-hle/modules/xmem.rs` | `LEONIDA_ALIAS_CHUNK=<pages>`, 16 unless set; 0: the whole range at once, as before. | +| `LEONIDA_ALIAS_SAME` | see the code | yes | | | `leonida-hle/modules/xmem.rs` | Whether [`map_alias`] leaves a page mapped that shows the page it is to show already (`LEONIDA_ALIAS_SAME=0`: unmapped and mapped again, as before). | | `LEONIDA_AUDIO_CAPTURE_OF` | see the code | | | | `leonida-hle/modules/audio/capture.rs` | | | `LEONIDA_BCPACK_DUMP` | see the code | | | yes | `leonida-hle/modules/dstorage.rs` | Leonida: with `LEONIDA_BCPACK_DUMP=<folder>`, the first 400 BCPack streams of each BC format are written there as they come (`bc<n>-<k>.bin`: the format and the unpacked size as two little-endian u32, then the stream), t... | | `LEONIDA_DSP_CONVOLVE` | see the code | | | | `leonida-hle/modules/dsp.rs` | `LEONIDA_DSP_CONVOLVE=0` turns that off. shortcut: stereo and 512-frame convolutions and the other block transforms are not computed; their outputs are zeros. | -| `LEONIDA_DSP_GAIN` | see the code | | | | `leonida-hle/modules/dsp.rs` | `LEONIDA_DSP_GAIN`, else 2. | +| `LEONIDA_DSP_GAIN` | see the code | | | | `leonida-hle/modules/dsp.rs` | What the computed convolutions are scaled by: `LEONIDA_DSP_GAIN`, else 2. | | `LEONIDA_DSTORAGE_HALF` | see the code | | | | `leonida-hle/modules/dstorage.rs` | Whether a queue submits itself once half of it is enqueued (`LEONIDA_DSTORAGE_HALF=1`), as DirectStorage for the PC does and as ours did. | | `LEONIDA_DSTORAGE_IO` | see the code | | | | `leonida-hle/modules/dstorage.rs` | How files are read (`LEONIDA_DSTORAGE_IO`). | | `LEONIDA_DSTORAGE_LOG` | see the code | | | | `leonida-hle/modules/dstorage.rs` | The streaming log (`LEONIDA_DSTORAGE_LOG=<file>`): a line for every request (`R`: queue, number, file, offset, source bytes, destination bytes, options, when enqueued, submitted, started, done, result), every status entr... | @@ -617,12 +608,12 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_KBM_SETTLE_MS` | see the code | | | | `leonida-hle/modules/gameinput/kbm.rs` | `LEONIDA_KBM_SETTLE_MS` (400; 0..3000) is the pause after a change. | | `LEONIDA_KEYS` | see the code | | | | `leonida-hle/modules/gameinput.rs` +1 | The scripted keys (`LEONIDA_KEYS`) also press the first pad's buttons, by the stand-in pad's table: with a real pad connected the stand-in is not there, and a title that listens to the pad (the title's start screen) saw... | | `LEONIDA_MAP_LEAN` | see the code | | | | `leonida-hle/modules/xmem.rs` | Whether a mapping change asks the host only for what it needs: no split of a placeholder that is already the view's own, no commit of section pages that are committed (`LEONIDA_MAP_LEAN=0`: both every time, as before). | -| `LEONIDA_MOUSE_CURVE` | see the code | | | | `leonida-hle/modules/gameinput.rs` | `LEONIDA_MOUSE_SENSITIVITY` (1; 0.1..10), `LEONIDA_MOUSE_DEADZONE` (0.24), `LEONIDA_MOUSE_CURVE` (0.6), `LEONIDA_MOUSE_INVERT_Y` (0). | -| `LEONIDA_MOUSE_DEADZONE` | see the code | | | | `leonida-hle/modules/gameinput.rs` | `LEONIDA_MOUSE_SENSITIVITY` (1; 0.1..10), `LEONIDA_MOUSE_DEADZONE` (0.24), `LEONIDA_MOUSE_CURVE` (0.6), `LEONIDA_MOUSE_INVERT_Y` (0). | -| `LEONIDA_MOUSE_INVERT_Y` | see the code | | | | `leonida-hle/modules/gameinput.rs` | `LEONIDA_MOUSE_SENSITIVITY` (1; 0.1..10), `LEONIDA_MOUSE_DEADZONE` (0.24), `LEONIDA_MOUSE_CURVE` (0.6), `LEONIDA_MOUSE_INVERT_Y` (0). | +| `LEONIDA_MOUSE_CURVE` | see the code | | | | `leonida-hle/modules/gameinput.rs` | | +| `LEONIDA_MOUSE_DEADZONE` | see the code | | | | `leonida-hle/modules/gameinput.rs` | | +| `LEONIDA_MOUSE_INVERT_Y` | see the code | | | | `leonida-hle/modules/gameinput.rs` | | | `LEONIDA_MOUSE_LOOK` | see the code | | | | `leonida-hle/modules/gameinput.rs` | `LEONIDA_MOUSE_LOOK=0` turns mouse look off (and with it the click that takes the mouse). | -| `LEONIDA_MOUSE_SENSITIVITY` | see the code | | | | `leonida-hle/modules/gameinput.rs` | `LEONIDA_MOUSE_SENSITIVITY` (1; 0.1..10), `LEONIDA_MOUSE_DEADZONE` (0.24), `LEONIDA_MOUSE_CURVE` (0.6), `LEONIDA_MOUSE_INVERT_Y` (0). | -| `LEONIDA_ONE_PAD` | see the code | | | | `leonida-hle/modules/gameinput.rs` | `LEONIDA_ONE_PAD=0` shows each host pad as a device of its own, and the stand-in only while there is none). | +| `LEONIDA_MOUSE_SENSITIVITY` | see the code | | | | `leonida-hle/modules/gameinput.rs` | | +| `LEONIDA_ONE_PAD` | see the code | | | | `leonida-hle/modules/gameinput.rs` | Whether the title sees one pad that is always there, fed by the keyboard and by every host pad (on by default; `LEONIDA_ONE_PAD=0` shows each host pad as a device of its own, and the stand-in only while there is none). | | `LEONIDA_PAD_QUICK` | see the code | | | | `leonida-hle/modules/gameinput.rs` | ... counts), the keyboard and mouse every [`POLL`] as before (`LEONIDA_PAD_QUICK=0`: everything every [`POLL`]).... | | `LEONIDA_PC_GLYPHS` | see the code | | | | `leonida-hle/modules/glyphs.rs` +1 | ...hs.py` \| \| keyboard and mouse \| `pc_prompt_glyphs.gfx`, or `LEONIDA_PC_GLYPHS` \| `tools/pc_prompt_glyphs.py` \| How the swap finds the stream without the archive's table of contents (encrypted, and not used by this port):... | | `LEONIDA_PROCESS_PRIORITY` | see the code | | | | `leonida-hle/runtime.rs` | `LEONIDA_PROCESS_PRIORITY=normal`: as it was started. | @@ -641,12 +632,12 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | Name | Kind | A/B | L | F | Named in | In the code's words | |---|---|---|---|---|---|---| | `LEONIDA_CLZERO_ASK` | see the code | | | | `leonida-loader/console_insn.rs` | `LEONIDA_CLZERO_ASK=1` asks every time, as before. | -| `LEONIDA_NO_WATCHDOG` | see the code | | | | `leonida-loader/hooks.rs` +1 | LEONIDA_RENDER_SCALE / LEONIDA_OWN_UPSCALER / LEONIDA_NO_WATCHDOG title patches. | +| `LEONIDA_NO_WATCHDOG` | see the code | | | | `leonida-loader/hooks.rs` +1 | LOCAL (leonida-perf, via our wt5): LEONIDA_RENDER_SCALE / LEONIDA_OWN_UPSCALER / LEONIDA_NO_WATCHDOG title patches. | | `LEONIDA_OUTPUT_1440` | see the code | | | | `leonida-loader/hooks.rs` | | | `LEONIDA_PATCH_CLZERO` | see the code | | | | `leonida-loader/console_insn.rs` | `LEONIDA_PATCH_CLZERO=0` emulates each time, as before. | | `LEONIDA_PATCH_WAITS` | see the code | | | | `leonida-loader/console_insn.rs` | `LEONIDA_PATCH_WAITS=0` emulates each time, as before. | | `LEONIDA_PROFILE_ONLY` | see the code | | | yes | `leonida-loader/profile.rs` | `LEONIDA_PROFILE_ONLY=<name>[,<name>..]` samples only the threads whose name or start (`module+rva`) holds one of them, which makes the rounds short. | -| `LEONIDA_RENDER_SCALE_MIN` | see the code | | | | `leonida-loader/hooks.rs` +1 | | +| `LEONIDA_RENDER_SCALE_MIN` | see the code | | yes | | `leonida-loader/hooks.rs` +1 | | | `LEONIDA_SIM_MAX_STEP_MS` | see the code | | | | `leonida-loader/hooks.rs` +1 | The ceiling `LEONIDA_SIM_MAX_STEP_MS` asks for: `Some(None)` for the title's own, `None` if not one of them. | | `LEONIDA_STACKS` | see the code | | | | `leonida-loader/profile.rs` +1 | `LEONIDA_STACKS=<seconds>[,<seconds>...]` prints each thread's unwound stack as `module+rva` that many seconds after [`dump_stacks_on_schedule`], to find what a title waits on. | @@ -671,18 +662,18 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | `LEONIDA_DESC_WHY` | see the code | | | | `leonida-shader/emit/lower.rs` | | | `LEONIDA_DIV_FIXUP_ZERO_FIRST` | see the code | | | | `leonida-shader/emit/lower.rs` | `LEONIDA_DIV_FIXUP_ZERO_FIRST=0` restores the old lowering. | | `LEONIDA_GROUP_SYNC` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | `LEONIDA_GROUP_SYNC`: - unset or `2`: every barrier waits, as before. - `1`: the title's `s_barrier` waits only in a block every lane runs, in a program no lane can be cut out of at the iteration limit. - `0`: no barrier... | -| `LEONIDA_HDR_CLAMP` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | `LEONIDA_HDR_CLAMP=0`: written as they are, as before). | +| `LEONIDA_HDR_CLAMP` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | Whether the float colours a pixel program writes are held to what every HDR format of the console can hold, [-65024, 65024] (on; `LEONIDA_HDR_CLAMP=0`: written as they are, as before). | | `LEONIDA_LDS_EXACT` | see the code | | | yes | `leonida-shader/emit/lds_exact.rs` | `LEONIDA_LDS_EXACT=0` turns this off. | | `LEONIDA_LDS_INIT_HOIST` | see the code | | | yes | `leonida-shader/emit/lds_init.rs` | `LEONIDA_LDS_INIT_HOIST=0` turns it off. | | `LEONIDA_LOOPS_WAVE` | see the code | | | yes | `leonida-shader/emit/lower.rs` +4 | `LEONIDA_LOOPS_WAVE`: - unset or `1`: console wave64 compute programs on a host of 32-lane waves; - `0`: none; - `2`: every compute program. | | `LEONIDA_LSHL_ADD_SCC` | see the code | | | | `leonida-shader/emit/lower.rs` | `LEONIDA_LSHL_ADD_SCC=0` restores the old lowering. | -| `LEONIDA_MED3_CLAMP` | see the code | | | yes | `leonida-shader/emit/lower.rs` | `LEONIDA_MED3_CLAMP=0`: the general form, as before): the same bits, with fewer instructions (bounds -1 and 2: 20 to 14). | +| `LEONIDA_MED3_CLAMP` | see the code | | | yes | `leonida-shader/emit/lower.rs` | Whether the median of a value and two constants that are normal numbers or infinities is a clamp (`Lower::med3_clamp`; `LEONIDA_MED3_CLAMP=0`: the general form, as before): the same bits, with fewer instructions (bounds... | | `LEONIDA_MESH_COUNTS` | see the code | | | yes | `leonida-shader/emit/lower.rs` +1 | A mesh program's own output counts (`LEONIDA_MESH_COUNTS=1`; off by default). | | `LEONIDA_MESH_LOOP_EXITS` | see the code | | | yes | `leonida-shader/emit/lower.rs` | `LEONIDA_MESH_LOOP_EXITS`, on unless `0` (then a lane at the limit leaves the program from inside the loop, [`Lower::abort_block`], as before). | -| `LEONIDA_MINMAX_NONZERO` | see the code | | | yes | `leonida-shader/emit/lower.rs` | `LEONIDA_MINMAX_NONZERO=0`: as before). | -| `LEONIDA_NAN_SCRUB_INF` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | `LEONIDA_NAN_SCRUB_INF=0`: 0, as before). | -| `LEONIDA_NAN_SCRUB_STORE_INF` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | `LEONIDA_NAN_SCRUB_STORE_INF=0`: as the colours, held at 65504 with its sign or 0 by [`nan_scrub_holds_infinity`], as before). | -| `LEONIDA_NULL_VIEW_SIZE` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | `LEONIDA_NULL_VIEW_SIZE=0`: the host's zeros less one, as before). | +| `LEONIDA_MINMAX_NONZERO` | see the code | | | yes | `leonida-shader/emit/lower.rs` | Whether a float maximum or minimum with a constant whose magnitude bits are not all zero leaves out the test for two zeros (`Lower::max_min`; `LEONIDA_MINMAX_NONZERO=0`: as before). | +| `LEONIDA_NAN_SCRUB_INF` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | Whether the scrub (`LEONIDA_NAN_SCRUB`) holds an infinity at the largest finite half-float of its sign, 65504, instead of making it 0 (on; `LEONIDA_NAN_SCRUB_INF=0`: 0, as before). | +| `LEONIDA_NAN_SCRUB_STORE_INF` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | ...e scrub (`LEONIDA_NAN_SCRUB`) still makes NaN 0 there (on; `LEONIDA_NAN_SCRUB_STORE_INF=0`: as the colours, held at 65504 with its sign or 0 by [`nan_scrub_holds_infinity`], as before).... | +| `LEONIDA_NULL_VIEW_SIZE` | see the code | | | | `leonida-shader/emit/lower.rs` +1 | ...nd one level, as the console's empty descriptor reads (on; `LEONIDA_NULL_VIEW_SIZE=0`: the host's zeros less one, as before).... | | `LEONIDA_SCALAR_MINMAX_SCC` | see the code | | | | `leonida-shader/emit/lower.rs` | `LEONIDA_SCALAR_MINMAX_SCC=0` restores the old lowering. | | `LEONIDA_SHADER_LOOP_LIMIT` | see the code | | | | `leonida-shader/emit/mod.rs` | With the `diagnostics` feature, `LEONIDA_SHADER_LOOP_LIMIT` (decimal or `0x` hex, at least 1) sets it instead. | | `LEONIDA_SHADER_OPT` | see the code | | | yes | `leonida-shader/emit/bitcode/opt.rs` +2 | `LEONIDA_SHADER_OPT`: - unset: every pass but the wide loads (447). - `0`: none (the module as the lowering made it). - a number (decimal or `0x` hex): those passes; 1 dead code, 2 constants and identities, 4 one instruc... | @@ -697,11 +688,14 @@ and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. | Name | Kind | A/B | L | F | Named in | In the code's words | |---|---|---|---|---|---|---| | `LEONIDA_HAIR_SHADOW_MASKS` | see the code | | | | `scripts/play-nvidia.ps1` | | -| `LEONIDA_REFRESH_NEXT` | see the code | | | | `scripts/play-nvidia.ps1` | | | `LEONIDA_SKIP_RT_RESOLVE` | see the code | | | | `scripts/play-nvidia.ps1` | | | `LEONIDA_TITLE_GRAPHICS` | see the code | | | yes | `scripts/play-nvidia.ps1` | | | `LEONIDA_WATER_TRANSMISSION` | see the code | | | yes | `scripts/play-nvidia.ps1` | | ## Only in tests -Read by test code alone, or made up by it: `LEONIDA_A`, `LEONIDA_B`, `LEONIDA_BCPACK_CASES`, `LEONIDA_BCPACK_TABLES`, `LEONIDA_BENCH_FILE`, `LEONIDA_BENCH_HOLES`, `LEONIDA_CONSOLE_DXC`, `LEONIDA_DIFF_ONLY`, `LEONIDA_EXIT_CHILD`, `LEONIDA_HOST_LOCK_CHILD`, `LEONIDA_MENU_PREVIEW`, `LEONIDA_NONE_SUCH`, `LEONIDA_PC_DXC`, `LEONIDA_PLACES_DIR`, `LEONIDA_PLACES_RUN`, `LEONIDA_PROBE`, `LEONIDA_PROBE_STREAMLINE`, `LEONIDA_REF_PS`, `LEONIDA_REF_VS`, `LEONIDA_SAVE_CHILD`, `LEONIDA_SAVE_OP`, `LEONIDA_SAVE_STOP`, `LEONIDA_TEST_D3D_DEBUG`, `LEONIDA_TEST_ROUNDS`, `LEONIDA_TRAP_LOG`, `LEONIDA_XMA_REFERENCE`, `LEONIDA_XMA_STREAMS`. +Read by test code alone, or made up by it: `LEONIDA_A`, `LEONIDA_B`, `LEONIDA_BCPACK_CASES`, `LEONIDA_BCPACK_TABLES`, `LEONIDA_BENCH_CS`, `LEONIDA_BENCH_FILE`, `LEONIDA_BENCH_HOLES`, `LEONIDA_BENCH_N`, `LEONIDA_BENCH_S`, `LEONIDA_BENCH_THREADS`, `LEONIDA_BENCH_WARP`, `LEONIDA_BLOCK_WAY`, `LEONIDA_CONSOLE_DXC`, `LEONIDA_DIFF_ONLY`, `LEONIDA_EXIT_CHILD`, `LEONIDA_HOST_LOCK_CHILD`, `LEONIDA_MENU_PREVIEW`, `LEONIDA_NONE_SUCH`, `LEONIDA_PC_DXC`, `LEONIDA_PLACES_DIR`, `LEONIDA_PLACES_RUN`, `LEONIDA_PROBE`, `LEONIDA_PROBE_STREAMLINE`, `LEONIDA_REF_PS`, `LEONIDA_REF_VS`, `LEONIDA_SAVE_CHILD`, `LEONIDA_SAVE_OP`, `LEONIDA_SAVE_STOP`, `LEONIDA_TEST_D3D_DEBUG`, `LEONIDA_TEST_ROUNDS`, `LEONIDA_TILES_TEST_CARD`, `LEONIDA_TRAP_LOG`, `LEONIDA_XMA_REFERENCE`, `LEONIDA_XMA_STREAMS`. + +## Only in comments + +Named in a comment of `d3d12/` and read nowhere by that name: `LEONIDA_PLAYER_PROBE_MAX`, `LEONIDA_READ_WATCH`, `LEONIDA_REFRESH_NEXT`. diff --git a/docs/measuring_fps.md b/docs/measuring_fps.md index e97fe2a9e2..fdfe194f13 100644 --- a/docs/measuring_fps.md +++ b/docs/measuring_fps.md @@ -7,8 +7,8 @@ of switches in [d3d12/docs/switches.md](../d3d12/docs/switches.md). ## 1. Look first Search [findings.md](../d3d12/docs/findings.md) for the switch or the function you have in mind, on a fresh `main`. -Many switches have been measured there, with the card, the scene, the method and the spread. On the night of -2026-11-29 several runs on two PCs went into `LEONIDA_COPYBACK_ELIDE`, whose entry already said "not usable here". +Many switches have been measured there, with the card, the scene, the method and the spread. `LEONIDA_COPYBACK_ELIDE`, for one, +has an entry that says "not usable here". ## 2. Turn the switch inside one run @@ -18,6 +18,11 @@ both sides are measured in one scene, at one cache temperature, beside the same - It needs a build with `diagnostics` (the one `d3d12/scripts/build-nvidia.ps1` makes) and more than one second a phase. - Up to eight switches; switch number *n* is on in the phases whose number has bit *n*, so every combination comes round. +- Give it to the launcher: `-More @{LEONIDA_AB='4,LEONIDA_STORE_BESIDE'}`. `play-nvidia.ps1` removes the `LEONIDA_*` + variables of the window it starts in (four paths aside), so `$env:LEONIDA_AB = ...` before it is lost without a word. + The same goes for every variable of section 5. +- More than eight names, or a phase of one second or less, and there is no A/B at all, again without a word. Look for + the `A/B phase` lines in the log. - A switch named there no longer goes by its own variable. Only switches the code reads that way follow it; for any other name the phases are logged and nothing changes, so check the name in [switches.md](../d3d12/docs/switches.md) or the code before you believe a "no difference". @@ -25,13 +30,14 @@ both sides are measured in one scene, at one cache temperature, beside the same - Each phase ends with a line `A/B phase bits on [...]`: frames, mean, median, p90, draws a frame, the card's idle and busy time a frame and the submitting thread's work a frame. The first second of a phase is left out. -Phases of 3.5 to 4 s worked there. The idle camera goes round views of about 24 s with different draw counts, so phases -of 15 s measured the views rather than the switch. Standing, `findings.md` cuts the phases into stretches where the draw count -jumps, leaves out the first phase of a stretch and fits a level for each stretch; walking, it takes the mean of the differences of -neighbouring phases. Give the effect **with its standard error**. The scripts it names for this (`ab_pair.py`, `ab_eff.py`) are not in +Phases of 3.5 to 4 s worked in the runs of `findings.md` (one PC, one save: "about measuring there"). The idle camera +there goes round views of about 24 s with different draw counts, so phases of 15 s measured the views, not the switch. Standing, `findings.md` cuts the phases into stretches where the draw count +jumps, leaves out the first phase of a stretch and fits a level for each stretch; walking, the switch of bit *b* +has runs of 2^*b* phases off and 2^*b* on: each pair of neighbouring runs gives one difference, and their mean is the effect. Give the effect **with its standard error**. The scripts it names for this (`ab_pair.py`, `ab_eff.py`) are not in the repository. -That gave about 0.2 to 0.8 ms of spread for a standing run of some minutes and 1 to 2 ms for a walking one. Two separate +The standard errors in `findings.md` are mostly 0.2 to 0.6 ms for a standing run of some minutes (up to 0.94) and 1 to +2 ms for a walking one (up to 2.24). Two separate runs of one setting differed by 7 ms in one of its tables (75.0 and 82.1 ms). ## 3. When only separate runs will do @@ -40,13 +46,13 @@ A change of code, or a switch that cannot be turned in play, needs separate runs - The same save for every start. The title rewrites its autosave, so keep a copy and put it back before each start (and the player's own back afterwards). -- Alternate (A B B A), in one sitting, with a throwaway run first: one PC's first measured run after a warm-up came out slowest - in both series it was looked for in (2026-11-30; not explained). +- Alternate (A B B A), in one sitting, with a throwaway run first: on one PC the first measured run after a + warm-up came out slowest in both of two series (seen once, 2026-11-30, not in `findings.md`, not explained). - After a translator change, or on a new build, play a while first. Until its pipelines are made, a run measures that. - The same programs in the background, and nothing heavy beside it: no compiler, no test suite. `findings.md` has one build at 16.2 to 17.3 and then 12.8 frames a second; what had changed was the programs that start with Windows. -- Check every run for the state you think it was in: it reached the world, it did not stay in the menu, it did not end early. A run - that stayed in the menu shows 60. +- Check every run for the state you think it was in: it reached the world, it did not stay in the menu, it did not end early. One that + stayed in the menu showed 60 throughout (seen once, 2026-11-30). - With two runs a side, do not claim a difference smaller than the spread between runs of the same side. ## 4. Which number means what @@ -69,10 +75,8 @@ All in builds with `diagnostics`; each costs something, so do not read frame rat | Tool | What it answers | |---|---| | `LEONIDA_TIMELINE=` (with `LEONIDA_TIMELINE_AT`, `LEONIDA_TIMELINE_FRAMES`) | A trace of a few frames for `chrome://tracing` or Perfetto, and a text summary with **the chain of work and waits each present came out of**: the tool for "what does the frame wait for". | -| `LEONIDA_PROFILE=,,,` (with `LEONIDA_PROFILE_ONLY=`) | Stack samples by thread, waits included, from inside the process. Do not name the title's own threads: `findings.md` has a run that ended that way. | -| `LEONIDA_GPU_TIMING=1` | The commands' time on the card. | - -Windows Performance Recorder works too (it needs an administrator). Wait until it says that the trace was saved before you open the file. +| `LEONIDA_PROFILE=,,,` (with `LEONIDA_PROFILE_ONLY=`) | Stack samples by thread, waits included, from inside the process. Always with `LEONIDA_PROFILE_ONLY` and a thread of the runtime: without it the busiest threads are taken, the title's among them, and `findings.md` has a run that a walk of a title's stack ended. For those, use the timeline. | +| `LEONIDA_GPU_TIMING=1` with `LEONIDA_D3D12_DRED=1` | The commands' time on the card. The launcher sets `LEONIDA_D3D12_DRED` to `faults`, which is not enough, so give both. Each list is then submitted on its own and `LEONIDA_LATE_WAIT` is off: good for which command costs what, not for how long the frame is. | ## 6. Before you report a cause diff --git a/tests/test_d3d12_switches.py b/tests/test_d3d12_switches.py index e1e30c325d..85b95e5aef 100644 --- a/tests/test_d3d12_switches.py +++ b/tests/test_d3d12_switches.py @@ -57,9 +57,9 @@ def test_only_a_name_the_ab_macros_take_is_marked_for_ab(self): self.assertFalse(self.found["LEONIDA_SLOW"]["ab"]) def test_test_modules_are_told_from_code_after_them_and_from_outline_modules(self): - self.assertTrue(self.found["LEONIDA_TEST_CHILD"]["tests"]) - self.assertFalse(self.found["LEONIDA_AFTER_OUTLINE"]["tests"]) - self.assertFalse(self.found["LEONIDA_LAST"]["tests"]) + self.assertFalse(self.found["LEONIDA_TEST_CHILD"]["read"]) + self.assertTrue(self.found["LEONIDA_AFTER_OUTLINE"]["read"]) + self.assertTrue(self.found["LEONIDA_LAST"]["read"]) def test_a_test_file_is_all_tests(self): found = ds.collect({GPU + "x_tests.rs": 'fn f() { std::env::var("LEONIDA_ONLY_HERE"); }'}) @@ -80,6 +80,59 @@ def test_a_longer_name_is_not_taken_for_a_shorter_one(self): def test_a_prefix_is_not_a_name(self): self.assertEqual(ds.NAME.findall("`LEONIDA_VIPATCH_` and LEONIDA_X"), ["LEONIDA_X"]) + def test_every_way_the_launcher_assigns_is_seen(self): + names = ["LEONIDA_A1", "LEONIDA_A2", "LEONIDA_A3", "LEONIDA_A4", "LEONIDA_A5", "LEONIDA_A6"] + source = "\n".join(f'v("{n}")' for n in names) + launcher = ("$settings = @{ LEONIDA_A1 = '1'; LEONIDA_A2 = '1' }\n $settings.LEONIDA_A3 = '1'\n" + "if ($settings.LEONIDA_A4 -eq '1') { }\n# LEONIDA_A5 = '1'\n$env:LEONIDA_A6 = '1'\n") + found = ds.collect({GPU + "a.rs": source}, launcher=launcher) + self.assertEqual([n for n in names if found[n]["launcher"]], + ["LEONIDA_A1", "LEONIDA_A2", "LEONIDA_A3", "LEONIDA_A6"]) + + def test_a_switch_read_by_turns_elsewhere_is_for_ab_and_of_no_known_kind(self): + source = """fn a() { leonida_gpu::switched("LEONIDA_HLE") } +const SWITCH: &str = "LEONIDA_BY_CONST"; +fn b() { if let Some(on) = crate::ab::pick(SWITCH) { } } +const SWITCH: &str = "LEONIDA_NOT_AB"; +fn wide(switch: &'static str) -> bool { + if let Some(on) = crate::ab::pick(switch) { return on; } + false +} +fn c() { wide("LEONIDA_BY_FN"); narrow("LEONIDA_OTHER_FN") } +const NAMES: [&str; 2] = ["LEONIDA_L_A", "LEONIDA_L_B"]; +fn d() { NAMES.iter().map(|name| crate::ab::bit(name)) } +fn e() { asked_for!("LEONIDA_BY_MACRO") } +""" + found = ds.collect({GPU + "a.rs": source}) + self.assertEqual({n for n, e in found.items() if e["ab"]}, + {"LEONIDA_HLE", "LEONIDA_BY_CONST", "LEONIDA_BY_FN", "LEONIDA_L_A", "LEONIDA_L_B", "LEONIDA_BY_MACRO"}) + self.assertEqual(ds.kind(found["LEONIDA_HLE"]["uses"], "LEONIDA_HLE"), "see the code") + + def test_a_brace_in_a_raw_string_does_not_end_a_test_module(self): + source = '#[cfg(all(test, windows))]\nmod tests {\n const S: &str = r#"\nvoid main() {\n}\n"#;\n' \ + ' fn f() { v("LEONIDA_AFTER_RAW") }\n}\nfn g() { v("LEONIDA_REAL") }\n' + found = ds.collect({GPU + "a.rs": source}) + self.assertFalse(found["LEONIDA_AFTER_RAW"]["read"]) + self.assertTrue(found["LEONIDA_REAL"]["read"]) + + def test_an_outline_test_module_is_tests(self): + found = ds.collect({GPU + "a.rs": "#[cfg(test)]\nmod bench;\n", GPU + "a/bench.rs": 'v("LEONIDA_B1")', + GPU + "b/bench.rs": 'v("LEONIDA_B2")'}) + self.assertFalse(found["LEONIDA_B1"]["read"]) + self.assertTrue(found["LEONIDA_B2"]["read"]) + + def test_a_name_only_in_a_comment_is_not_listed_as_read_and_a_placeholder_not_at_all(self): + found = ds.collect({GPU + "a.rs": "// `LEONIDA_OLD` was a switch once.\n// `LEONIDA_X` is any.\n"}) + self.assertFalse(found["LEONIDA_OLD"]["read"]) + self.assertNotIn("LEONIDA_X", found) + self.assertNotIn("| `LEONIDA_OLD`", ds.page(found)) + self.assertEqual(ds.difference(found, "| `LEONIDA_OLD` | x"), ([], ["LEONIDA_OLD"])) + + def test_a_piece_of_a_sentence_that_says_nothing_is_not_taken(self): + self.assertEqual(ds.sentence("The joined lists (a pool of them: `LEONIDA_J`, 48). Next.", "LEONIDA_J"), + "The joined lists (a pool of them: `LEONIDA_J`, 48).") + self.assertEqual(ds.sentence("`LEONIDA_J`.", "LEONIDA_J"), "") + def test_a_launcher_value_is_never_copied(self): found = ds.collect({GPU + "a.rs": 'x("LEONIDA_LIST")'}, launcher="LEONIDA_LIST = 'a long value'") self.assertTrue(found["LEONIDA_LIST"]["launcher"]) @@ -88,8 +141,8 @@ def test_a_launcher_value_is_never_copied(self): class PageTest(unittest.TestCase): def test_cells_do_not_break_the_table(self): - found = ds.collect({GPU + "a.rs": '/// `LEONIDA_X=|`: one of two.\nfn f() { v("LEONIDA_X"); }'}) - row = next(line for line in ds.page(found).splitlines() if line.startswith("| `LEONIDA_X`")) + found = ds.collect({GPU + "a.rs": '/// `LEONIDA_WAY=|`: one of two.\nfn f() { v("LEONIDA_WAY"); }'}) + row = next(line for line in ds.page(found).splitlines() if line.startswith("| `LEONIDA_WAY`")) self.assertEqual(len(re.findall(r"(?= 3: + break + else: + start = starts[-1] + said = text[start:stop].strip() + if words(said) < 3: + return "" if len(said) > LONGEST: # Keep the name in what is left: cut the front when it lies too far in. at = m.start() - start @@ -96,7 +152,7 @@ def kind(uses, name): text = "\n".join(uses) if re.search(rf"toggled!\(\s*{quoted}", text): return "on, `0` turns it off" - if re.search(rf"(asked!|switch::on|switched)\(\s*{quoted}", text): + if re.search(rf"(asked!|switch::on)\(\s*{quoted}", text): return "off unless set and not `0`" return "see the code" @@ -106,36 +162,34 @@ def collect(files, launcher="", findings=""): found = {} def entry(name): - return found.setdefault(name, {"files": set(), "uses": [], "said": "", "ab": False, "tests": True, + return found.setdefault(name, {"files": set(), "uses": [], "said": "", "ab": False, "tests": False, "read": False, "launcher": False, "findings": False}) + outline = test_files(files) for rel in sorted(files): lines = files[rel].splitlines() - if not rel.endswith(".rs"): - for line in lines: - for name in NAME.findall(line): - e = entry(name) - e["files"].add(rel) - e["tests"] = False - continue - whole, tests = is_test_file(rel), test_lines(lines) + rust = rel.endswith(".rs") + whole = rust and (is_test_file(rel) or rel in outline) + tests = test_lines(files[rel]) if rust else set() for i, line in enumerate(lines): - comment = COMMENT.match(line) - for name in (NAME.findall(line) if comment else LITERAL.findall(line)): + comment = COMMENT.match(line) if rust else re.match(r"\s*(?:#|rem\b|::)", line, re.I) + for name in LITERAL.findall(line) if rust and not comment else NAME.findall(line): e = entry(name) + e["files"].add(rel) if comment: - e["files"].add(rel) continue - e["files"].add(rel) - # A call that breaks the line before its argument still says what it is. - e["uses"].append((lines[i - 1].strip() if i else "") + " " + line.strip()) - if not whole and i not in tests: - e["tests"] = False - for name, e in found.items(): - if not e["uses"]: - e["tests"] = False - uses = "\n".join(e["uses"]) - e["ab"] = bool(re.search(rf'(toggled!|asked!|ab::pick|ab::bit)\(\s*"{name}"', uses)) + if whole or i in tests: + e["tests"] = True + continue + e["read"] = True + if rust: + # A call that breaks the line before its argument still says what it is. + e["uses"].append((lines[i - 1].strip() if i else "") + " " + line.strip()) + if rust and not whole: + for name in ab_names(files[rel]): + entry(name)["ab"] = True + for name in PLACEHOLDERS: + found.pop(name, None) for rel in sorted(files): if not rel.endswith(".rs"): continue @@ -147,7 +201,8 @@ def entry(name): e = found.get(name) if e is not None and said and (not e["said"] or (here and not e.get("here"))): e["said"], e["here"] = said, here - for name in {n for line in launcher.splitlines() for n in ASSIGNED.findall(line)}: + for name in {n for line in launcher.splitlines() + if not line.lstrip().startswith("#") for n in ASSIGNED.findall(line)}: if name in found: found[name]["launcher"] = True for name in set(NAME.findall(findings)): @@ -170,21 +225,23 @@ def where(files): def page(found): - real = {n: e for n, e in found.items() if not e["tests"]} - tests = sorted(n for n, e in found.items() if e["tests"]) + real = {n: e for n, e in found.items() if e["read"]} + tests = sorted(n for n, e in found.items() if e["tests"] and not e["read"]) + named = sorted(n for n, e in found.items() if not e["tests"] and not e["read"]) said = sum(1 for e in real.values() if e["said"]) out = [ "# The D3D12 runtime's `LEONIDA_*` variables", "", "Made by `python -I tools/d3d12_switches.py --out d3d12/docs/switches.md` from the sources of `d3d12/`; do not", - "edit it by hand. It says which names exist and what the code's own comments say of them. It is **not** a list of", - "recommended settings and says nothing of what a switch gains: for that read [findings.md](findings.md) first,", + "edit it by hand. No CI job keeps it up to date: run the command again, or `--check`, when you need it current.", + "It says which names exist and what the code's own comments say of them. It is **not** a list of recommended", + "settings and says nothing of what a switch gains: for that read [findings.md](findings.md) first,", "and [how to measure frame rates](../../docs/measuring_fps.md) before trying one.", "", f"{len(real)} names; {said} of them are named in a comment of the code, the others have none yet.", "", "- **Kind**: how the code reads it, where that can be told. \"see the code\" is a number, a path, a list or a", " switch read some other way; its default is not given here.", "- **A/B**: `LEONIDA_AB` can turn it while the title runs (builds with `diagnostics`), where the code reads it by", - " name that way. Blank means it was not found so, not that it cannot; the comment may say more.", - "- **L**: the NVIDIA launcher (`d3d12/scripts/play-nvidia.ps1`) has an assignment for it.", + " name that way. Blank means it was not found so, not that it cannot.", + "- **L**: the NVIDIA launcher (`d3d12/scripts/play-nvidia.ps1`) has an assignment for it, perhaps only with some option.", "- **F**: named in [findings.md](findings.md), which is where a measurement would be.", "- **In the code's words**: the sentence of the comment that names it, cut to one line. Comments go out of date;", " the code is what counts.", "", @@ -204,6 +261,9 @@ def page(found): out.append("") if tests: out += ["## Only in tests", "", "Read by test code alone, or made up by it: " + ", ".join(f"`{n}`" for n in tests) + ".", ""] + if named: + out += ["## Only in comments", "", "Named in a comment of `d3d12/` and read nowhere by that name: " + + ", ".join(f"`{n}`" for n in named) + ".", ""] return "\n".join(out) @@ -213,7 +273,8 @@ def difference(found, text): tests = re.search(r"^Read by test code alone.*$", text, re.M) if tests: listed |= set(NAME.findall(tests.group(0))) - return sorted(set(found) - listed), sorted(listed - set(found)) + now = {n for n, e in found.items() if e["read"] or e["tests"]} + return sorted(now - listed), sorted(listed - now) def gather(root): From bf85962d40c654c7a5ebff049af6840f860c6ee0 Mon Sep 17 00:00:00 2001 From: MoonEyes <14891700+MoonEyes@users.noreply.github.com> Date: Mon, 30 Nov 2026 10:52:27 +0100 Subject: [PATCH 3/6] docs: say what the count of the switches page counts Co-Authored-By: Claude Opus 5.5 --- d3d12/docs/switches.md | 2 +- tools/d3d12_switches.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/d3d12/docs/switches.md b/d3d12/docs/switches.md index 80611355de..3a97035e97 100644 --- a/d3d12/docs/switches.md +++ b/d3d12/docs/switches.md @@ -6,7 +6,7 @@ It says which names exist and what the code's own comments say of them. It is ** settings and says nothing of what a switch gains: for that read [findings.md](findings.md) first, and [how to measure frame rates](../../docs/measuring_fps.md) before trying one. -630 names; 591 of them are named in a comment of the code, the others have none yet. +630 names; 591 have a sentence of a comment below, the others no comment or only a bare list. - **Kind**: how the code reads it, where that can be told. "see the code" is a number, a path, a list or a switch read some other way; its default is not given here. diff --git a/tools/d3d12_switches.py b/tools/d3d12_switches.py index 34cec54e15..55d2d26aaa 100644 --- a/tools/d3d12_switches.py +++ b/tools/d3d12_switches.py @@ -236,7 +236,7 @@ def page(found): "It says which names exist and what the code's own comments say of them. It is **not** a list of recommended", "settings and says nothing of what a switch gains: for that read [findings.md](findings.md) first,", "and [how to measure frame rates](../../docs/measuring_fps.md) before trying one.", "", - f"{len(real)} names; {said} of them are named in a comment of the code, the others have none yet.", "", + f"{len(real)} names; {said} have a sentence of a comment below, the others no comment or only a bare list.", "", "- **Kind**: how the code reads it, where that can be told. \"see the code\" is a number, a path, a list or a", " switch read some other way; its default is not given here.", "- **A/B**: `LEONIDA_AB` can turn it while the title runs (builds with `diagnostics`), where the code reads it by", From 6a321e5db48aa9d31fcec9bc34b4dea3a7ac2885 Mon Sep 17 00:00:00 2001 From: MoonEyes <14891700+MoonEyes@users.noreply.github.com> Date: Mon, 30 Nov 2026 11:23:47 +0100 Subject: [PATCH 4/6] tools: d3d12_switches and d3d12_run_fps set errors=replace on stdout tests/test_tool_stdout_encoding.py asks it of every tool. d3d12_run_fps.py came in with #2594 without it, which left that test red on main. Co-Authored-By: Claude Opus 5.5 --- tools/d3d12_run_fps.py | 4 ++++ tools/d3d12_switches.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tools/d3d12_run_fps.py b/tools/d3d12_run_fps.py index 7a1fd28367..72515890e4 100644 --- a/tools/d3d12_run_fps.py +++ b/tools/d3d12_run_fps.py @@ -252,4 +252,8 @@ def main(argv=None) -> int: if __name__ == "__main__": + try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode + sys.stdout.reconfigure(errors="replace") + except (AttributeError, ValueError, OSError): + pass sys.exit(main()) diff --git a/tools/d3d12_switches.py b/tools/d3d12_switches.py index 55d2d26aaa..86b322ad7b 100644 --- a/tools/d3d12_switches.py +++ b/tools/d3d12_switches.py @@ -320,4 +320,8 @@ def main(argv=None): if __name__ == "__main__": + try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode + sys.stdout.reconfigure(errors="replace") + except (AttributeError, ValueError, OSError): + pass sys.exit(main()) From 42b1f4ae4bd0aa40b79066f66d5ff11736231643 Mon Sep 17 00:00:00 2001 From: Kal0s-design <356578040+Kal0s-design@users.noreply.github.com> Date: Mon, 30 Nov 2026 11:28:39 +0100 Subject: [PATCH 5/6] d3d12: a guard page fails a copy and stays a guard page Title memory has guard pages: stack guards, and guards the title sets up itself. A copy, put or merge of title memory (safecopy, under the write-catch handler in watch.rs) that touched one took STATUS_GUARD_PAGE_VIOLATION, which clears the page's guard flag. The handler sent every fault inside a copy to the copy's failing exit, whatever the code, and nothing set the flag again: the page stayed an ordinary page, so the title's next touch of it no longer raised the guard fault it was set up for. A guard fault inside a copy now sets the guard flag again on its page, with the protection the page has, and fails the copy as before. The re-arm checks that the page is still committed and that VirtualProtect succeeds; a re-arm that fails, or a guard fault with no address, is counted (NOT_REARMED) and the first one is logged. A guard fault outside a copy still goes on to the next handler. Tests: the source and destination cases for copy, put and merge (all four fail on main with "...cleared the guard flag" / "the guard flag was consumed"), and a_page_that_cannot_be_guarded_again_is_counted. Port of zocram4cc's fix and tests in the sibling VIctory tree (TaynanGT/Vice-Tay fa11650 and c277533, GPL-3.0). Co-Authored-By: zocram4cc <79211006+zocram4cc@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 --- d3d12/crates/leonida-gpu/src/safecopy.rs | 71 +++++++++++++++++++- d3d12/crates/leonida-gpu/src/watch.rs | 82 +++++++++++++++++++++++- 2 files changed, 149 insertions(+), 4 deletions(-) diff --git a/d3d12/crates/leonida-gpu/src/safecopy.rs b/d3d12/crates/leonida-gpu/src/safecopy.rs index 1bb3ad17c9..57e6cc2226 100644 --- a/d3d12/crates/leonida-gpu/src/safecopy.rs +++ b/d3d12/crates/leonida-gpu/src/safecopy.rs @@ -362,8 +362,8 @@ pub(crate) fn failing_exit(at: usize) -> Option { mod tests { use super::*; use windows_sys::Win32::System::Memory::{ - MEM_COMMIT, MEM_DECOMMIT, MEM_RELEASE, MEM_RESERVE, PAGE_NOACCESS, PAGE_READONLY, PAGE_READWRITE, VirtualAlloc, - VirtualFree, VirtualProtect, + MEM_COMMIT, MEM_DECOMMIT, MEM_RELEASE, MEM_RESERVE, MEMORY_BASIC_INFORMATION, PAGE_GUARD, PAGE_NOACCESS, + PAGE_READONLY, PAGE_READWRITE, VirtualAlloc, VirtualFree, VirtualProtect, VirtualQuery, }; struct Pages(*mut u8, usize); @@ -718,4 +718,71 @@ mod tests { } }); } + + /// Whether the page at `at` is a guard page. + fn guarded(at: usize) -> bool { + let mut info = MEMORY_BASIC_INFORMATION::default(); + // SAFETY: a valid out pointer of the right size. + assert_ne!(unsafe { VirtualQuery(at as *const _, &mut info, size_of_val(&info)) }, 0); + info.Protect & PAGE_GUARD != 0 + } + + /// Two pages, the second a guard page. + fn guard_second_page() -> Pages { + let pages = Pages::new(2 << 12); + let mut old = 0; + // SAFETY: the second page of our allocation. + unsafe { + assert_ne!(VirtualProtect(pages.0.add(4096).cast(), 4096, PAGE_READWRITE | PAGE_GUARD, &mut old), 0); + } + pages + } + + /// A guard page in the source fails the copy, and stays a guard page: the fault that reported it + /// cleared the flag, so it is set again. (zocram4cc, TaynanGT/Vice-Tay fa11650.) + #[test] + fn a_guard_page_fails_the_copy_and_stays_a_guard_page() { + assert!(on()); + let (a, mut to) = (guard_second_page(), vec![0u8; 2 << 12]); + // SAFETY: our allocation, its second page a guard page; the destination is ours. + assert!(!unsafe { copy(to.as_mut_ptr(), a.0, 8192) }); + assert!(guarded(a.0.addr() + 4096), "the guard flag was consumed"); + } + + /// A copy into a guard page fails, and the page stays a guard page. + #[test] + fn a_guard_page_in_the_destination_fails_a_copy_and_stays_guarded() { + assert!(on()); + let pages = guard_second_page(); + let at = pages.0.addr() + 4096; + let src = vec![0x5Au8; 4096]; + // SAFETY: the destination is a guard page of our allocation; the source is ours. + assert!(!unsafe { copy(at as *mut u8, src.as_ptr(), 4096) }); + assert!(guarded(at), "the copy's fault cleared the guard flag"); + } + + /// A put into a guard page fails, and the page stays a guard page. + #[test] + fn a_guard_page_in_the_destination_fails_a_put_and_stays_guarded() { + assert!(on()); + let pages = guard_second_page(); + let at = pages.0.addr() + 4096; + let (was, now) = (vec![0u8; 4096], vec![0x5Au8; 4096]); + // SAFETY: as above; every dword differs, so every block is written. + assert!(!unsafe { put_changed(at as *mut u8, &was, &now) }); + assert!(guarded(at), "the put's fault cleared the guard flag"); + } + + /// A merge into a guard page fails, and the page stays a guard page. + #[test] + fn a_guard_page_in_the_destination_fails_a_merge_and_stays_guarded() { + assert!(on()); + let pages = guard_second_page(); + let at = pages.0.addr() + 4096; + let (now, mut held) = (vec![0x5Au8; 4096], vec![0u8; 4096]); + // SAFETY: as above; `now` and `held` are ours and do not overlap. + let merged = unsafe { merge(at as *mut u8, now.as_ptr(), held.as_mut_ptr(), 4096, false) }; + assert!(!merged.there); + assert!(guarded(at), "the merge's fault cleared the guard flag"); + } } diff --git a/d3d12/crates/leonida-gpu/src/watch.rs b/d3d12/crates/leonida-gpu/src/watch.rs index 02edd8e29d..b5561fcd9d 100644 --- a/d3d12/crates/leonida-gpu/src/watch.rs +++ b/d3d12/crates/leonida-gpu/src/watch.rs @@ -4362,7 +4362,7 @@ fn title_memory_changed(at: usize, len: usize) -> std::sync::RwLockWriteGuard<'s /// Registers the handler that takes writes to guarded blocks, once, ahead /// of the crash reporter's. pub(crate) fn install() { - use windows_sys::Win32::Foundation::{EXCEPTION_ACCESS_VIOLATION, NTSTATUS}; + use windows_sys::Win32::Foundation::{EXCEPTION_ACCESS_VIOLATION, NTSTATUS, STATUS_GUARD_PAGE_VIOLATION}; use windows_sys::Win32::System::Diagnostics::Debug::{ AddVectoredExceptionHandler, EXCEPTION_CONTINUE_EXECUTION, EXCEPTION_CONTINUE_SEARCH, EXCEPTION_POINTERS, @@ -4390,7 +4390,14 @@ pub(crate) fn install() { || r.ExceptionInformation[0] != WRITE { return match ours { - Some(exit) => fail(exit), + Some(exit) => { + // A guard page of title memory fails the copy as the kernel's read would: the + // fault cleared its guard flag, so it is set again (or counted, if it cannot be). + if r.ExceptionCode == STATUS_GUARD_PAGE_VIOLATION { + rearm_guard((r.NumberParameters >= 2).then(|| r.ExceptionInformation[1])); + } + fail(exit) + } None if r.ExceptionCode == EXCEPTION_ACCESS_VIOLATION as NTSTATUS && r.NumberParameters >= 2 && r.ExceptionInformation[0] == READ @@ -4560,6 +4567,45 @@ pub(crate) fn fault_asks_line(frames: f64) { } /// Whether `at` is committed read-write memory now. +/// Sets the guard flag again on the page holding `at` (the address the fault reported, if it did), +/// with the protection the page has now: the fault cleared the flag. False, and counted by +/// [`not_rearmed`], if the address is not known, the page is not committed any more, or its +/// protection cannot be set. (zocram4cc, TaynanGT/Vice-Tay fa11650 and c277533.) +fn rearm_guard(at: Option) -> bool { + use windows_sys::Win32::System::Memory::{MEM_COMMIT, MEMORY_BASIC_INFORMATION, PAGE_GUARD, VirtualProtect, VirtualQuery}; + let done = at.is_some_and(|at| { + let page = at / KERNEL_PAGE * KERNEL_PAGE; + // SAFETY: plain data filled in by the query. + let mut info: MEMORY_BASIC_INFORMATION = unsafe { std::mem::zeroed() }; + let mut old = 0; + // SAFETY: valid out pointers of the right size; the protection change is of one page, and + // only if that page is committed. + unsafe { + VirtualQuery(page as *const _, &mut info, size_of_val(&info)) != 0 + && info.State == MEM_COMMIT + && VirtualProtect(page as *const _, KERNEL_PAGE, info.Protect | PAGE_GUARD, &mut old) != 0 + } + }); + if !done { + not_rearmed(at); + } + done +} + +/// Guard pages that a copy stopped at and that could not be guarded again. +static NOT_REARMED: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); + +/// Counts a guard page that could not be guarded again; the first is said (the title may then not +/// grow its stack, or catch that guard, at the page). +fn not_rearmed(at: Option) { + if NOT_REARMED.fetch_add(1, std::sync::atomic::Ordering::Relaxed) == 0 { + tracing::warn!( + at = format_args!("{:#x}", at.unwrap_or(0)), + "guard not re-armed: a copy of title memory took a guard page and it could not be set again (0: no address)" + ); + } +} + fn writable(at: usize) -> bool { use windows_sys::Win32::System::Memory::PAGE_READWRITE; if page_ask() @@ -6937,3 +6983,35 @@ mod port7_tests { unsafe { VirtualFree(at as *mut _, 0, MEM_RELEASE) }; } } + +#[cfg(test)] +mod rearm_tests { + use super::*; + use std::sync::atomic::Ordering::Relaxed; + use windows_sys::Win32::System::Memory::{ + MEM_COMMIT, MEM_DECOMMIT, MEM_RELEASE, MEM_RESERVE, MEMORY_BASIC_INFORMATION, PAGE_GUARD, PAGE_READWRITE, + VirtualAlloc, VirtualFree, VirtualQuery, + }; + + /// A committed page is guarded again; one that is not committed any more is not, and that is + /// counted, as is a fault that gave no address. + #[test] + fn a_page_that_cannot_be_guarded_again_is_counted() { + // SAFETY: a fresh page of our own. + let page = unsafe { VirtualAlloc(std::ptr::null(), 4096, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE) } as usize; + assert_ne!(page, 0); + let before = NOT_REARMED.load(Relaxed); + assert!(rearm_guard(Some(page))); + let mut info = MEMORY_BASIC_INFORMATION::default(); + // SAFETY: a valid out pointer of the right size. + assert_ne!(unsafe { VirtualQuery(page as *const _, &mut info, size_of_val(&info)) }, 0); + assert_ne!(info.Protect & PAGE_GUARD, 0, "a committed page is guarded again"); + // SAFETY: our page; decommitted, it is reserved and not committed. + unsafe { VirtualFree(page as *mut _, 4096, MEM_DECOMMIT) }; + assert!(!rearm_guard(Some(page)), "a page that is not committed cannot be guarded"); + assert!(!rearm_guard(None), "a fault that gave no address"); + assert_eq!(NOT_REARMED.load(Relaxed), before + 2); + // SAFETY: our allocation. + unsafe { VirtualFree(page as *mut _, 0, MEM_RELEASE) }; + } +} From d367675c705c758f731ae9eb603839a4ebb2283c Mon Sep 17 00:00:00 2001 From: ubiquitarianism <283527159+ubiquitarianism@users.noreply.github.com> Date: Mon, 30 Nov 2026 05:51:57 -0500 Subject: [PATCH 6/6] d3d12: index heap buffer spans as slots change (on in play-nvidia) --- d3d12/crates/leonida-gpu/src/draw.rs | 182 ++++++++- .../crates/leonida-gpu/src/draw/heap_sweep.rs | 287 +++++++++++++ .../leonida-gpu/src/draw/heap_sweep_tests.rs | 376 ++++++++++++++++++ d3d12/scripts/play-nvidia.ps1 | 4 + 4 files changed, 837 insertions(+), 12 deletions(-) create mode 100644 d3d12/crates/leonida-gpu/src/draw/heap_sweep.rs create mode 100644 d3d12/crates/leonida-gpu/src/draw/heap_sweep_tests.rs diff --git a/d3d12/crates/leonida-gpu/src/draw.rs b/d3d12/crates/leonida-gpu/src/draw.rs index bf52f10fbd..52631766d2 100644 --- a/d3d12/crates/leonida-gpu/src/draw.rs +++ b/d3d12/crates/leonida-gpu/src/draw.rs @@ -1621,11 +1621,153 @@ impl SweepRanges { } } +mod heap_sweep; +#[cfg(test)] +mod heap_sweep_tests; + +/// The selected backend owns the observed slots for a descriptor heap. +enum SweepState { + Legacy(SweepRanges), + Indexed(heap_sweep::IndexedSweep), +} + +impl SweepState { + fn new(indexed: bool) -> Self { + if indexed { + Self::Indexed(Default::default()) + } else { + Self::Legacy(Default::default()) + } + } + + fn clear(&mut self) { + match self { + Self::Legacy(sweep) => sweep.clear(), + Self::Indexed(sweep) => sweep.clear(), + } + } + + fn forget_part(&mut self, part: u32) { + match self { + Self::Legacy(sweep) => sweep.forget_part(part), + Self::Indexed(sweep) => sweep.forget_part(part), + } + } + + fn set(&mut self, slot: u32, range: Option>) { + match self { + Self::Legacy(sweep) => sweep.set(slot, range), + Self::Indexed(sweep) => sweep.set(slot, range), + } + } + + /// At a phase transition, transfer the ranges already observed while the + /// heap's sweep lock is held. The next pass consumes only its usual + /// changed slots. No descriptor is reread and the round stays in step. + #[cfg(any(test, feature = "diagnostics"))] + fn change_backend(&mut self, indexed: bool) { + if matches!(self, Self::Indexed(_)) == indexed { + return; + } + #[cfg(feature = "diagnostics")] + let began = std::time::Instant::now(); + let mut next = Self::new(indexed); + match self { + Self::Legacy(sweep) => { + for (slot, range) in sweep.ranges.0.iter_mut().enumerate() { + if let Some(range) = range.take() { + next.set(slot as u32, Some(range)); + } + } + } + Self::Indexed(sweep) => sweep.take_slots(|slot, range| next.set(slot, Some(range))), + } + *self = next; + #[cfg(feature = "diagnostics")] + tracing::info!(indexed, ms = began.elapsed().as_secs_f64() * 1000.0, "heap span backend changed for a timing turn"); + } + + fn snapshot(&mut self) -> SweepSnapshot<'_, T> { + match self { + Self::Legacy(sweep) => { + let (spans, views) = sweep.spans(); + SweepSnapshot::Legacy { spans, views } + } + Self::Indexed(sweep) => { + sweep.finish(); + SweepSnapshot::Indexed(sweep) + } + } + } +} + +/// The older sweep experiment needs the legacy backend in both of its phases. +fn indexed_sweep_allowed( + requested: bool, + legacy_in_ab: impl FnOnce() -> bool, + legacy_enabled: impl FnOnce() -> bool, +) -> bool { + requested && !legacy_in_ab() && legacy_enabled() +} + +fn sweep_spans_in_ab() -> bool { + #[cfg(feature = "diagnostics")] + { + crate::ab::bit("LEONIDA_SWEEP_SPANS").is_some() + } + #[cfg(not(feature = "diagnostics"))] + { + false + } +} + +impl Default for SweepState { + fn default() -> Self { + static INDEXED: std::sync::OnceLock = std::sync::OnceLock::new(); + Self::new(*INDEXED.get_or_init(|| { + let requested = crate::switch::on("LEONIDA_INDEX_HEAP_SPANS"); + let indexed = indexed_sweep_allowed(requested, sweep_spans_in_ab, sweep_spans); + if requested { + let backend = if indexed { "indexed" } else { "legacy" }; + tracing::info!(backend, "heap buffer span sweep backend selected"); + } + indexed + })) + } +} + +/// Both paths emit the same span per live copy at the same point in the +/// deferred list. Ordering within this group is unspecified: the legacy +/// snapshot is a hash table and a refresh reads source bytes into its own copy. +enum SweepSnapshot<'a, T> { + Legacy { + spans: crate::host::ByCopy>, + views: u32, + }, + Indexed(&'a heap_sweep::IndexedSweep), +} + +impl SweepSnapshot<'_, T> { + fn counts(&self) -> (usize, u32) { + match self { + Self::Legacy { spans, views } => (spans.len(), *views), + Self::Indexed(sweep) => (sweep.len(), sweep.views()), + } + } + + fn for_each(&self, visit: impl FnMut(&Span)) { + match self { + Self::Legacy { spans, .. } => spans.values().for_each(visit), + Self::Indexed(sweep) => sweep.values().for_each(visit), + } + } +} + /// Descriptor-derived references belong to the heap that produced them. #[derive(Default)] pub(crate) struct BufferSweep { passes: u64, - ranges: SweepRanges, + ranges: SweepState, // Last refresh frame and covered interval for throttled, unwatched copies. unwatched: std::collections::HashMap, } @@ -2079,6 +2221,10 @@ fn heap_buffer_pass(heap: &crate::descriptor::Heap, host: &crate::descriptor::ho // released resource goes stale without a write, and a slot written // before its memory had a host copy is only made then. let mut kept = host.buffer_sweep.lock().unwrap_or_else(|e| e.into_inner()); + #[cfg(feature = "diagnostics")] + if let Some(indexed) = crate::ab::pick("LEONIDA_INDEX_HEAP_SPANS") { + kept.ranges.change_backend(indexed_sweep_allowed(indexed, sweep_spans_in_ab, sweep_spans)); + } let changed = host.buffer_changes(); let all = kept.passes == 0 || (kept.passes % HEAP_ROUND == 0 && !heap_spread()); let slots = if all { @@ -2172,8 +2318,11 @@ fn heap_buffer_pass(heap: &crate::descriptor::Heap, host: &crate::descriptor::ho #[cfg(feature = "diagnostics")] let looked = std::time::Instant::now(); // Per host copy, the span its picked views cover ([`sweep_spans`]). - let (spans, views) = kept.ranges.spans(); - let bytes: u64 = spans.values().map(|s| s.2 - s.1).sum(); + let BufferSweep { + ranges, unwatched, .. + } = &mut *kept; + let spans = ranges.snapshot(); + let (copies, views) = spans.counts(); // Memory that is not write-watched is copied whole by every refresh. // It was once refreshed only every 120 frames (unmapped pages read // one by one cost 14 GB a frame in run 11, before they were @@ -2183,24 +2332,33 @@ fn heap_buffer_pass(heap: &crate::descriptor::Heap, host: &crate::descriptor::ho // costs some 30 ms a frame this way. static EVERY: std::sync::OnceLock = std::sync::OnceLock::new(); let every = *EVERY.get_or_init(|| { - std::env::var("LEONIDA_UNWATCHED_FRAMES").ok().and_then(|v| v.parse().ok()).unwrap_or(1) + std::env::var("LEONIDA_UNWATCHED_FRAMES") + .ok() + .and_then(|v| v.parse().ok()) + .unwrap_or(1) }); - let mut found = Vec::with_capacity(spans.len()); + let mut found = Vec::with_capacity(copies); + let mut bytes = 0; let mut next_unwatched = std::collections::HashMap::new(); - for (shadow, from, to) in spans.values() { + spans.for_each(|(shadow, from, to)| { + bytes += to - from; if every > 1 && shadow.unwatched() { let id = shadow.id(); - if let Some(&(last, low, high)) = kept.unwatched.get(&id) - && frame >= last && frame - last < every && low <= *from && *to <= high + if let Some(&(last, low, high)) = unwatched.get(&id) + && frame >= last + && frame - last < every + && low <= *from + && *to <= high { next_unwatched.insert(id, (last, low, high)); - continue; + return; } next_unwatched.insert(id, (frame, *from, *to)); } found.push((shadow.clone(), *from, (*to).min(*from + shadow.left(*from)))); - } - kept.unwatched = next_unwatched; + }); + drop(spans); + *unwatched = next_unwatched; drop(kept); #[cfg(feature = "diagnostics")] let refreshed = std::time::Instant::now(); @@ -2217,7 +2375,7 @@ fn heap_buffer_pass(heap: &crate::descriptor::Heap, host: &crate::descriptor::ho tracing::info!( slots = slots.len(), views, - copies = spans.len(), + copies, mb = bytes >> 20, ms = started.elapsed().as_millis(), "buffer views of the heap made ready for shaders that pick them by index" diff --git a/d3d12/crates/leonida-gpu/src/draw/heap_sweep.rs b/d3d12/crates/leonida-gpu/src/draw/heap_sweep.rs new file mode 100644 index 0000000000..24dfb2bcb4 --- /dev/null +++ b/d3d12/crates/leonida-gpu/src/draw/heap_sweep.rs @@ -0,0 +1,287 @@ +//! Incremental bounding spans for the buffer views of one descriptor heap. +use super::{PARTS, Span, copy_key}; +use crate::host::ByCopy; + +const NONE: u32 = u32::MAX; +// A slot is either vacant (0) or contains a member index plus one. The top +// bit marks a slot that was seen in the part we are currently looking at. +const SEEN: u32 = 1 << 31; + +#[derive(Default)] +struct Part { + slots: Vec, + revisiting: bool, +} + +#[derive(Clone, Copy)] +struct Member { + copy: u32, + previous: u32, + next: u32, + from: u64, + to: u64, +} + +struct CopySpan { + span: Span, + head: u32, + low_count: u32, + high_count: u32, + dirty: bool, +} + +impl CopySpan { + fn include(&mut self, from: u64, to: u64) { + if self.dirty { + return; + } + if from < self.span.1 { + self.span.1 = from; + self.low_count = 0; + } + if self.span.2 < to { + self.span.2 = to; + self.high_count = 0; + } + self.low_count += u32::from(from == self.span.1); + self.high_count += u32::from(to == self.span.2); + } + + fn exclude(&mut self, from: u64, to: u64) { + if self.dirty { + return; + } + self.low_count -= u32::from(from == self.span.1); + self.high_count -= u32::from(to == self.span.2); + self.dirty = self.low_count == 0 || self.high_count == 0; + } +} + +/// Slots contain only compact membership indices. Each live copy owns one +/// reference, and its members form a list so losing a unique endpoint only +/// revisits the slots of that copy. Indices are reused after unlinking. +pub(super) struct IndexedSweep { + parts: [Part; PARTS], + members: Vec, + vacant_members: Vec, + copies: Vec>>, + vacant_copies: Vec, + by_copy: ByCopy, + views: u32, +} + +impl Default for IndexedSweep { + fn default() -> Self { + Self { + parts: std::array::from_fn(|_| Part::default()), + members: Vec::new(), + vacant_members: Vec::new(), + copies: Vec::new(), + vacant_copies: Vec::new(), + by_copy: ByCopy::default(), + views: 0, + } + } +} + +impl IndexedSweep { + pub(super) fn clear(&mut self) { + for part in &mut self.parts { + part.slots.clear(); + part.revisiting = false; + } + self.members.clear(); + self.vacant_members.clear(); + self.copies.clear(); + self.vacant_copies.clear(); + self.by_copy.clear(); + self.views = 0; + } + + /// Retain the old memberships until the part is read again. At the end + /// of the pass, remove precisely the ones that were not seen anew. + pub(super) fn forget_part(&mut self, part: u32) { + let part = &mut self.parts[part as usize]; + if part.revisiting { + for slot in &mut part.slots { + *slot &= !SEEN; + } + } + part.revisiting = true; + } + + pub(super) fn set(&mut self, slot: u32, range: Option>) { + let p = slot as usize % PARTS; + let at = slot as usize / PARTS; + let mark = if self.parts[p].revisiting { SEEN } else { 0 }; + let old = self.parts[p].slots.get(at).copied().unwrap_or(0) & !SEEN; + let Some((owner, from, to)) = range else { + if old != 0 { + self.parts[p].slots[at] = 0; + self.unlink(old - 1); + } + return; + }; + + if old != 0 { + let member = &mut self.members[(old - 1) as usize]; + let copy = self.copies[member.copy as usize].as_mut().unwrap(); + if std::sync::Arc::ptr_eq(©.span.0, &owner) { + if (member.from, member.to) != (from, to) { + copy.exclude(member.from, member.to); + (member.from, member.to) = (from, to); + copy.include(from, to); + } + self.parts[p].slots[at] = old | mark; + return; + } + self.unlink(old - 1); + } + let member = self.link(owner, from, to); + let slots = &mut self.parts[p].slots; + if slots.len() <= at { + slots.resize(at + 1, 0); + } + slots[at] = (member + 1) | mark; + } + + fn link(&mut self, owner: std::sync::Arc, from: u64, to: u64) -> u32 { + let copies = &mut self.copies; + let vacant = &mut self.vacant_copies; + let copy = *self.by_copy.entry(copy_key(&owner)).or_insert_with(|| { + let new = CopySpan { + span: (owner, u64::MAX, 0), + head: NONE, + low_count: 0, + high_count: 0, + dirty: false, + }; + if let Some(id) = vacant.pop() { + copies[id as usize] = Some(new); + id + } else { + let id = u32::try_from(copies.len()).expect("too many heap buffer copies"); + copies.push(Some(new)); + id + } + }); + let span = copies[copy as usize].as_mut().unwrap(); + let node = Member { + copy, + previous: NONE, + next: span.head, + from, + to, + }; + let index = if let Some(index) = self.vacant_members.pop() { + self.members[index as usize] = node; + index + } else { + let index = u32::try_from(self.members.len()).expect("too many heap views"); + assert!(index < SEEN - 1, "too many addressable heap views"); + self.members.push(node); + index + }; + if span.head != NONE { + self.members[span.head as usize].previous = index; + } + span.head = index; + span.include(from, to); + self.views += 1; + index + } + + fn unlink(&mut self, index: u32) { + let member = self.members[index as usize]; + let slot = &mut self.copies[member.copy as usize]; + let copy = slot.as_mut().unwrap(); + if member.previous == NONE { + copy.head = member.next; + } else { + self.members[member.previous as usize].next = member.next; + } + if member.next != NONE { + self.members[member.next as usize].previous = member.previous; + } + if copy.head == NONE { + self.by_copy.remove(©_key(©.span.0)); + *slot = None; + self.vacant_copies.push(member.copy); + } else { + copy.exclude(member.from, member.to); + } + self.vacant_members.push(index); + self.views -= 1; + } + + /// Reconstruct the observed slots for a diagnostic switch of backends. + /// Finish a partially revisited part first so removed views stay absent. + #[cfg(any(test, feature = "diagnostics"))] + pub(super) fn take_slots(&mut self, mut visit: impl FnMut(u32, Span)) { + self.finish(); + for (part_index, part) in self.parts.iter().enumerate() { + for (row, &slot) in part.slots.iter().enumerate().filter(|(_, slot)| **slot != 0) { + let member = &self.members[(slot - 1) as usize]; + let copy = self.copies[member.copy as usize].as_ref().expect("live member has a copy"); + visit((row * PARTS + part_index) as u32, (copy.span.0.clone(), member.from, member.to)); + } + } + } + + pub(super) fn finish(&mut self) { + for p in 0..PARTS { + if !std::mem::take(&mut self.parts[p].revisiting) { + continue; + } + for at in 0..self.parts[p].slots.len() { + let slot = &mut self.parts[p].slots[at]; + if *slot & SEEN != 0 { + *slot &= !SEEN; + } else if *slot != 0 { + let member = std::mem::take(slot) - 1; + self.unlink(member); + } + } + } + for copy in self.copies.iter_mut().flatten() { + if !copy.dirty { + continue; + } + (copy.span.1, copy.span.2) = (u64::MAX, 0); + (copy.low_count, copy.high_count, copy.dirty) = (0, 0, false); + let mut index = copy.head; + while index != NONE { + let member = self.members[index as usize]; + copy.include(member.from, member.to); + index = member.next; + } + } + } + + pub(super) fn views(&self) -> u32 { + self.views + } + + pub(super) fn len(&self) -> usize { + self.by_copy.len() + } + + pub(super) fn values(&self) -> impl Iterator> { + self.copies.iter().flatten().map(|copy| ©.span) + } + + #[cfg(test)] + pub(super) fn storage(&self) -> (usize, usize) { + use std::mem::size_of; + let vectors = self + .parts + .iter() + .map(|p| p.slots.capacity() * size_of::()) + .sum::() + + self.members.capacity() * size_of::() + + self.vacant_members.capacity() * size_of::() + + self.copies.capacity() * size_of::>>() + + self.vacant_copies.capacity() * size_of::(); + (size_of::() + vectors, self.by_copy.capacity()) + } +} diff --git a/d3d12/crates/leonida-gpu/src/draw/heap_sweep_tests.rs b/d3d12/crates/leonida-gpu/src/draw/heap_sweep_tests.rs new file mode 100644 index 0000000000..129cd32107 --- /dev/null +++ b/d3d12/crates/leonida-gpu/src/draw/heap_sweep_tests.rs @@ -0,0 +1,376 @@ +use super::{PARTS, Span, SweepState, copy_key}; +use std::collections::BTreeMap; +use std::hint::black_box; +use std::mem::{size_of, size_of_val}; +use std::sync::Arc; +use std::time::{Duration, Instant}; + +type Update = (u32, Option>); + +fn pass( + sweep: &mut SweepState, + operations: impl IntoIterator, +) -> (u32, Vec>) { + for (slot, range) in operations { + sweep.set(slot, range); + } + let snapshot = sweep.snapshot(); + let (copies, views) = snapshot.counts(); + let mut refreshes = Vec::with_capacity(copies); + snapshot.for_each(|span| refreshes.push(span.clone())); + assert_eq!(refreshes.len(), copies); + (views, refreshes) +} + +fn ordered(sweep: (u32, Vec>)) -> (u32, Vec<(usize, u64, u64)>) { + let mut spans: Vec<_> = sweep + .1 + .iter() + .map(|(copy, low, high)| (copy_key(copy), *low, *high)) + .collect(); + spans.sort_unstable(); + (sweep.0, spans) +} + +fn oracle(slots: &BTreeMap>) -> (u32, Vec<(usize, u64, u64)>) { + let mut joined = BTreeMap::new(); + for (copy, low, high) in slots.values() { + let span = joined.entry(copy_key(copy)).or_insert((*low, *high)); + (span.0, span.1) = (span.0.min(*low), span.1.max(*high)); + } + ( + slots.len() as u32, + joined + .into_iter() + .map(|(key, (low, high))| (key, low, high)) + .collect(), + ) +} + +#[test] +fn index_turns_preserve_changed_revisited_and_absent_slots() { + let a = std::sync::Arc::new(1); + let b = std::sync::Arc::new(2); + let mut sweep = SweepState::new(false); + let mut expected = BTreeMap::new(); + for slot in 0..130u32 { + let span = (if slot % 3 == 0 { b.clone() } else { a.clone() }, u64::from(slot), u64::from(slot + 30)); + sweep.set(slot, Some(span.clone())); + expected.insert(slot, span); + } + for indexed in [true, false, true, false] { + let part = if indexed { 0 } else { 7 }; + sweep.forget_part(part); + expected.retain(|slot, _| slot % super::PARTS as u32 != part); + let new = (b.clone(), 2048, 4096); + sweep.set(part, Some(new.clone())); + expected.insert(part, new); + sweep.change_backend(indexed); + assert_eq!(ordered(pass(&mut sweep, std::iter::empty())), oracle(&expected)); + } +} + +#[test] +fn indexed_sweep_selector_preserves_legacy_overrides() { + use super::indexed_sweep_allowed; + + let should_not_check = || panic!("disabled index must skip compatibility checks"); + // An A/B script does not request the distinct fixed index scalar. + assert!(!indexed_sweep_allowed( + false, + should_not_check, + should_not_check + )); + assert!(indexed_sweep_allowed(true, || false, || true)); + assert!(!indexed_sweep_allowed(true, || false, || false)); + + // Do not inspect the sampled phase of a legacy A/B experiment. + assert!(!indexed_sweep_allowed(true, || true, should_not_check)); +} + +#[test] +#[ignore = "run in a fresh process with the sweep flags and expected backend"] +fn indexed_sweep_production_default() { + let expected = std::env::var("LEONIDA_BENCH_EXPECT_HEAP_SWEEP") + .expect("set LEONIDA_BENCH_EXPECT_HEAP_SWEEP to legacy or indexed"); + assert!( + matches!(expected.as_str(), "legacy" | "indexed"), + "unknown expected heap sweep backend {expected}" + ); + let actual = match super::BufferSweep::default().ranges { + SweepState::Legacy(_) => "legacy", + SweepState::Indexed(_) => "indexed", + }; + assert_eq!(actual, expected.as_str()); + println!("production heap sweep backend={actual}"); +} + +#[test] +fn indexed_sweep_matches_all_slots_during_rotations_and_recovery() { + let copies: Vec<_> = (0..32).map(Arc::new).collect(); + let mut sweeps = [SweepState::new(false), SweepState::new(true)]; + let mut slots: BTreeMap> = BTreeMap::new(); + let mut state = 142u64; + let mut random = |n: usize| { + state = state + .wrapping_mul(6364136223846793005) + .wrapping_add(1442695040888963407); + ((state >> 32) as usize) % n + }; + for frame in 0..192 { + if frame % 53 == 0 { + slots.clear(); + for sweep in &mut sweeps { + sweep.clear(); + } + } + // Some passes rotate twice before the result is taken, including + // rereading a part whose previous reads have not been published. + let part = frame % PARTS; + let rotations = if frame % 7 == 0 { 2 } else { 1 }; + for _ in 0..rotations { + slots.retain(|&slot, _| slot as usize % PARTS != part); + for sweep in &mut sweeps { + sweep.forget_part(part as u32); + } + for turn in 0..160 { + let slot = if turn < 100 { + (random(120) * PARTS + part) as u32 + } else { + random(9000) as u32 + }; + let range = match random(5) { + 0 => None, + 1 => slots.get(&slot).cloned(), + 2 => slots + .get(&slot) + .map(|(copy, low, high)| (copy.clone(), low.saturating_sub(2), high + 1)), + _ => { + let low = random(140) as u64; + Some(( + copies[random(copies.len())].clone(), + low, + low + random(500) as u64, + )) + } + }; + match &range { + Some(range) => { + slots.insert(slot, range.clone()); + } + None => { + slots.remove(&slot); + } + } + for sweep in &mut sweeps { + sweep.set(slot, range.clone()); + } + } + } + let expected = oracle(&slots); + for sweep in &mut sweeps { + assert_eq!(ordered(pass(sweep, [])), expected, "frame={frame}"); + assert_eq!( + ordered(pass(sweep, [])), + expected, + "frame={frame}, unchanged" + ); + } + } + slots.clear(); + for sweep in &mut sweeps { + sweep.clear(); + assert_eq!(ordered(pass(sweep, [])), (0, Vec::new())); + } + assert!(copies.iter().all(|copy| Arc::strong_count(copy) == 1)); +} + +#[test] +fn indexed_sweep_repairs_tied_extrema_and_drops_the_last_owner() { + let a = Arc::new(8); + let b = Arc::new(8); // Equal data is not descriptor copy identity. + let mut sweep = SweepState::new(true); + let inspect = + |s: &mut SweepState, views, spans| assert_eq!(ordered(pass(s, [])), (views, spans)); + for (slot, low, high) in [(0, 10, 67), (16, 10, 55), (32, 13, 67), (7, 11, 51)] { + sweep.set(slot, Some((a.clone(), low, high))); + } + inspect(&mut sweep, 4, vec![(copy_key(&a), 10, 67)]); + sweep.set(0, None); + inspect(&mut sweep, 3, vec![(copy_key(&a), 10, 67)]); + + sweep.set(16, Some((a.clone(), 12, 60))); + sweep.set(32, None); + inspect(&mut sweep, 2, vec![(copy_key(&a), 11, 60)]); + + sweep.forget_part(0); + sweep.set(16, Some((b.clone(), u64::MAX, u64::MAX))); + let mut spans = vec![(copy_key(&a), 11, 51), (copy_key(&b), u64::MAX, u64::MAX)]; + spans.sort_unstable(); + inspect(&mut sweep, 2, spans); + sweep.set(7, None); + inspect(&mut sweep, 1, vec![(copy_key(&b), u64::MAX, u64::MAX)]); + assert_eq!(Arc::strong_count(&a), 1); + + // A write can reuse the retired membership indices in a different part. + sweep.set(999_999, Some((a.clone(), 0, 0))); + sweep.forget_part(0); + inspect(&mut sweep, 1, vec![(copy_key(&a), 0, 0)]); + assert_eq!(Arc::strong_count(&b), 1); + sweep.clear(); + assert_eq!(Arc::strong_count(&a), 1); +} + +struct Fixture { + name: &'static str, + domain: usize, + occupied: usize, + copies: usize, + dirty_stride: usize, + churn: bool, +} + +fn timed_frame( + sweep: &mut SweepState, + part: u32, + updates: &[Update], +) -> (Duration, (u32, Vec>)) { + let started = Instant::now(); + sweep.forget_part(part); + let output = pass(sweep, updates.iter().cloned()); + (started.elapsed(), black_box(output)) +} + +fn print_storage(fixture: &Fixture, legacy: &SweepState, indexed: &SweepState) { + let SweepState::Legacy(legacy) = legacy else { + unreachable!() + }; + let SweepState::Indexed(indexed) = indexed else { + unreachable!() + }; + let (index_bytes, hash_capacity) = indexed.storage(); + let legacy_bytes = + size_of_val(legacy) + legacy.ranges.0.capacity() * size_of::>>(); + let legacy_hash_capacity: usize = legacy.spans.iter().map(|h| h.capacity()).sum(); + println!( + "{} memory: legacy arrays={legacy_bytes} B, part hash capacity={legacy_hash_capacity} entries; indexed arrays={index_bytes} B, copy hash capacity={hash_capacity} entries", + fixture.name, + ); +} + +fn time_fixture(fixture: Fixture) { + let owners: Vec<_> = (0..fixture.copies as u32).map(Arc::new).collect(); + let mut records: Vec = (0..fixture.occupied) + .map(|i| { + let slot = (i * fixture.domain / fixture.occupied) as u32; + let owner = if i < fixture.copies { + i + } else { + (i * 31337 ^ (i >> 4)) % fixture.copies + }; + let base = (owner as u64) << 20; + let (low, high) = if i < fixture.copies { + (base, base + 900_000) + } else { + let low = base + 64 + ((i * 373) % 32_000) as u64; + (low, low + (i % 2048) as u64) + }; + (slot, Some((owners[owner].clone(), low, high))) + }) + .collect(); + + let mut modes = [SweepState::new(false), SweepState::new(true)]; + let [legacy, indexed] = modes.each_mut(); + let original = pass(legacy, records.iter().cloned()); + let revised = pass(indexed, records.iter().cloned()); + assert_eq!(ordered(original), ordered(revised)); + println!( + "{}: {} addressable slots, {} live slot records, {} distinct copies", + fixture.name, fixture.domain, fixture.occupied, fixture.copies, + ); + + // Round zero warms both modes. One measured round per partition gives a + // full sweep rotation, with each implementation first eight times. + for frame in 0..=PARTS { + let part = frame % PARTS; + let mut updates = Vec::new(); + for (i, (slot, range)) in records.iter_mut().enumerate() { + let rotated = *slot as usize % PARTS == part; + let anchor = fixture.churn && i < fixture.copies && (i + frame) % 4 == 0; + if !rotated && !anchor && (i + frame) % fixture.dirty_stride != 0 { + continue; + } + if anchor { + let next = (i + frame) / 4; + let base = (i as u64) << 20; + *range = match next % 3 { + 0 => None, + 1 => Some((owners[i].clone(), base + 15_000, base + 32_000)), + _ => Some((owners[i].clone(), base, base + 900_000)), + }; + } + if rotated && range.is_none() && !anchor { + continue; // No longer a buffer slot in the rotated part. + } + updates.push((*slot, range.clone())); + } + let mut times = [Duration::ZERO; 2]; + let mut outputs = [None, None]; + for mode in [frame % 2, 1 - frame % 2] { + let (took, output) = timed_frame(&mut modes[mode], part as u32, black_box(&updates)); + times[mode] = took; + outputs[mode] = Some(ordered(output)); + } + assert_eq!(outputs[0], outputs[1], "{} frame={frame}", fixture.name); + let (views, spans) = outputs[0].as_ref().unwrap(); + if frame != 0 { + let bytes: u64 = spans.iter().map(|&(_, from, to)| to - from).sum(); + println!( + "{} frame={frame:02} updates={} covered_views={views} refreshes={} bytes={bytes} legacy={:.3} ms indexed={:.3} ms", + fixture.name, + updates.len(), + spans.len(), + times[0].as_secs_f64() * 1e3, + times[1].as_secs_f64() * 1e3, + ); + } + } + print_storage(&fixture, &modes[0], &modes[1]); +} + +#[test] +#[ignore = "synthetic CPU paired timings; run optimized with --ignored --nocapture"] +fn indexed_sweep_paired_bench() { + assert!( + super::sweep_spans(), + "use the default legacy partition sweep" + ); + for fixture in [ + Fixture { + name: "sparse-high", + domain: 975_000, + occupied: 236_000, + copies: 4_697, + dirty_stride: 49, + churn: false, + }, + Fixture { + name: "dense-smaller", + domain: 78_000, + occupied: 72_000, + copies: 4_400, + dirty_stride: 25, + churn: false, + }, + Fixture { + name: "endpoint-churn", + domain: 975_000, + occupied: 236_000, + copies: 4_697, + dirty_stride: 47, + churn: true, + }, + ] { + time_fixture(fixture); + } +} diff --git a/d3d12/scripts/play-nvidia.ps1 b/d3d12/scripts/play-nvidia.ps1 index 5403115b40..4f40e20599 100644 --- a/d3d12/scripts/play-nvidia.ps1 +++ b/d3d12/scripts/play-nvidia.ps1 @@ -242,6 +242,10 @@ $settings = @{ # (In the same run LEONIDA_REFRESH_NEXT, the next submission's front spans refreshed early by helpers, found # ~24 spans and no bytes to copy and cost +1.2 ms (+-0.7); LEONIDA_WIDE_SPIN=30 -0.6 (+-1.8). Both left off.) LEONIDA_COPY_SCOPED = '1' + # Keep the buffer range covered by each host copy up to date as its heap slots change. + # Series X, RX 6800 (2026-11-30): ab-22, 130 walking phases, 63 pairs, frame median -4.8 ms, + # mean -4.7, p90 -6.0. In ab-21, 49 moving road phases, 20 pairs, median -3.7, mean -4.2, p90 -6.6. + LEONIDA_INDEX_HEAP_SPANS = '1' # Leonida: the list ahead of each frame recorded by two threads (above: left off on the RX 6800). Series X, RTX # 4060 Ti, Ryzen 5 7600X, standing (2026-11-30, runs whab1 and whab2, LEONIDA_AB in turns of 4 s with three other # helper switches, 77 world phases each): the frame -0.22 (+-0.29) and -0.73 (+-0.39) ms median, -0.65 (+-0.40) and