Repository navigation
Conversation
docs/env_switches.tsv has one row per switch: 257 in all, 255 read by the host, the apps and the tools, and 2 read only by tests. Each row gives:
- the name;
- the class: 15 player, 40 path, 78 switch, 122 diagnostic, 2 test;
- a one-line meaning;
- since: the commit that introduced the switch, so a reviewer can check the meaning against it;
- the files that read it and the docs that mention it.
Before this, 70 of the 257 were mentioned in no doc.
dm/tools/env_switches.py writes the table. "read in" and "documented in" come from the sources; class, meaning and since are kept by hand and carried over. test_env_switches.py runs `env_switches.py --check`, which fails on:
- a switch read but not listed, so a new getenv("DM_...") needs its row and meaning;
- a row for a switch nothing reads any more;
- a row without a meaning.
dm/tools/env_switch_draft.py gathers the material for a meaning:
- the reading line and the code comments that name the switch;
- the commit that introduced it, and for a removed one the commit that removed it, each with the paragraph of its message that names it;
- the doc lines that mention it.
The commits come from one pass over the history (git log -p, with git log -S for names only shell scripts read), cached in .git per revision.
The meanings were drafted from that material and reviewed against the code; none is marked "unclear". One finding: DM_MOVIE is read into g_flag.movie, and nothing reads that flag.
docs/development.md's tool table links the table. No getenv changes.
26 of 42 tasks
seedds
added a commit
that referenced
this pull request
Oct 26, 2026
…318) Add docs/env_switches.tsv, one row per switch with its class (player, path, switch, diagnostic, test) and a one-line meaning: 257 switches, 70 of which no doc mentioned before. dm/tools/env_switches.py writes it from the sources and keeps the hand-written class and meaning; test_env_switches.py fails when the code reads a switch the table does not list, when a row names a switch nothing reads any more, or when a row has no meaning. It also prints the names the docs quote that nothing reads. The check compares only the set of names, so mentioning a switch in a doc, moving a file or reading a switch in a second place does not fail it. A macro name stays listed when the code also reads it from the environment (DM_GAME_ENV overrides the profile's macro of that name). Remove DM_MOVIE: it set g_flag.movie, which nothing read. Validation: test_env_switches and test_docs pass; a doc mention of an undocumented switch passes the check and an unlisted getenv fails it; the Mac host builds for Mario's profile. Co-authored-by: v0lumehi <34629096+v0lumehi@users.noreply.github.com>
Owner
|
Thanks. This landed on main as cc626e7, squashed with some changes and with you as co-author:
Your meanings went in unchanged. The tool still prints the names the docs quote that nothing reads, which is what #312 covers. |
Know-It-All-Brother
pushed a commit
to Know-It-All-Brother/nxnative
that referenced
this pull request
Nov 9, 2026
…eedds#318) Add docs/env_switches.tsv, one row per switch with its class (player, path, switch, diagnostic, test) and a one-line meaning: 257 switches, 70 of which no doc mentioned before. dm/tools/env_switches.py writes it from the sources and keeps the hand-written class and meaning; test_env_switches.py fails when the code reads a switch the table does not list, when a row names a switch nothing reads any more, or when a row has no meaning. It also prints the names the docs quote that nothing reads. The check compares only the set of names, so mentioning a switch in a doc, moving a file or reading a switch in a second place does not fail it. A macro name stays listed when the code also reads it from the environment (DM_GAME_ENV overrides the profile's macro of that name). Remove DM_MOVIE: it set g_flag.movie, which nothing read. Validation: test_env_switches and test_docs pass; a doc mention of an undocumented switch passes the check and an unlisted getenv fails it; the Mac host builds for Mario's profile. Co-authored-by: v0lumehi <34629096+v0lumehi@users.noreply.github.com>
ltrdpper
pushed a commit
to ltrdpper/BananaNative
that referenced
this pull request
Nov 16, 2026
…ines; large files are read one at a time' (seedds#318) from Wick3dPhant0m/BananaNative:split-large-files into android Reviewed-on: https://git.eden-emu.dev/moceure/BananaNative/pulls/318
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every DM_* environment switch the code reads, in one table with its meaning
The host, the apps and the tools read their switches from the environment through
getenv("DM_...")andos.environ, but nothing listed them. Of the 257 switches the code reads today, 70 were mentioned in no doc at all. The rest were spread over the game notes, the references, the agents' guides and code comments. And a removed one could linger in the docs (#312).This adds
docs/env_switches.tsv, one row per switch:`=<MB>` logs every 30 s how much of each window of that size in the alias region is mappedThe 257 are 255 read by the host, the apps and the tools, and 2 read only by tests.
dm/tools/env_switches.pywrites the table. It takes the generated columns from the sources and carries the hand-kept ones over.dm/tools/tests/test_env_switches.pyrunsenv_switches.py --checkin CI's tool tests. It works as a ratchet: today's 257 are the baseline. It fails when:getenv("DM_...")has no row and meaning;I checked that adding an unlisted
getenv("DM_FAKE_NEW")fails it.dm/tools/env_switch_draft.py <name>gathers what is known about a switch, for whoever writes or reviews a row:The history comes from one
git log -ppass, plusgit log -Sfor names only shell scripts read. It is cached in.git.docs/development.md. Its tool table links the table.The meanings were drafted from that material and checked against the code. None had to be left as "unclear".
One finding:
DM_MOVIEis read intog_flag.movie, and nothing reads that flag, so it has no effect; its row says so. I left the code alone: this PR changes nogetenvand no runtime behaviour.Checked
test_env_switchespasses, and fails with an unlisted switch added.test_docspasses.ci.sh(host tests, CPU gfx tests, every gfx test built,dmhostfor three profiles, the iOS compile check, all tool tests): no failures.