Skip to content

tests: sync the xgameruntime override table with the shim - #8359

Open
wavehs wants to merge 1 commit into
ItsNotRexed:mainfrom
wavehs:test/xgameruntime-env-table-sync
Open

wavehs wants to merge 1 commit into
ItsNotRexed:mainfrom
wavehs:test/xgameruntime-env-table-sync

Conversation

@wavehs

@wavehs wavehs commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: #8186 (comment)

What and why

tests/test_docs_env_vars.py only requires a LEONIDA_* variable to be named in some Markdown page. That leaves runtime/README.md's xgameruntime.dll "environment overrides" table free to drift from runtime/shims/xgameruntime.cpp in both directions: a new override read by the shim without a row, or a row that outlives the variable.

New tests/test_docs_runtime_env_table.py:

  • takes the table's first-column variables from the section headed "What xgameruntime.dll reports: environment overrides" (stopping at the next heading, so a row elsewhere does not count);
  • takes the string literals the shim reads ("LEONIDA_…", L"LEONIDA_…"), excluding LEONIDA_GAME_DIR (it sets the game folder, not an answer, and is documented lower on the page);
  • reports both directions, with a synthetic control that checks a missing row, an extra row and a row outside the section.

The real check passes on main 23060e08: the table lists exactly LEONIDA_DEVICE_TYPE, LEONIDA_ANALYTICS_FORM, LEONIDA_PACKAGE_ID, LEONIDA_CONTENT_PACKAGES and LEONIDA_PACKAGED, and the shim reads those five plus LEONIDA_GAME_DIR.

This is deliberately separate from #8080 (which updates the content-package rows): the test keeps the table and the shim in step afterwards.

Tested

macOS arm64 (Apple M3 Pro), Python 3.15.2, CPU only, no GPU or game files:

AI-assisted: yes (an agent session).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator rule here.)

test_docs_env_vars only requires each LEONIDA_* name to appear somewhere. Add a two-way check between runtime/README.md's environment-override table and the literals runtime/shims/xgameruntime.cpp reads, with a synthetic control for a missing row and an extra row; LEONIDA_GAME_DIR is excluded because it sets the game folder, not an answer.
@molodayamama

Copy link
Copy Markdown

Verified commit 8cddec126cf3de5a22e2fecef614394f8eea0278. Three tests passed on Windows. The checker found the known overrides in the shim and the corresponding documentation rows, and the mismatch fixture covers both directions: undocumented variables and documented variables absent from the shim.

AI-assisted verification.

@RAINighty

Copy link
Copy Markdown

Tested 8cddec126 merged with main 6dda0630b (clean merge) on Windows 11 (10.0.26300), Python 3.13.15 in UTF-8 mode (PYTHONUTF8=1; venv with the pinned tests/requirements.txt), with llvm-mc 21.1.8 (AMDGPU) and SPIRV-Tools v2026.4 on PATH: pass.

  • tests/test_docs_runtime_env_table.py with this PR: passes (Ran 3 tests in 0.006s, OK). On main: a new file, so there is nothing to run there.
  • New test file and no implementation change in this PR, so there is nothing to run a control against; the new cases pass.
  • Code not reviewed beyond running it. No GPU or game files.

AI-assisted (Claude Code).

@cryptocxeq cryptocxeq left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent CPU regression review of 8cddec126cf3de5a22e2fecef614394f8eea0278 applied to main snapshot 32a50c949e882ae539f2d54be93fadd50ce76cae.

python -I tests/test_docs_runtime_env_table.py: 3 tests pass on Windows / CPython 3.11.15. The checker compares both missing and extra entries inside the specific override section, preserves row order for the known-row check and explicitly excludes the game-folder variable. I disabled mismatches() by making it always return two empty lists: test_the_checker_reports_both_directions fails, so the mismatch assertions are live.

The scope is a textual string-literal inventory: it can count a variable name appearing in a comment or non-read string, and it does not prove shim runtime behavior. No blocking issue found for the current source/table consistency check. No shim build, game files, GPU or external toolchain used.

Claim: #8344 (comment)
AI-assisted (OpenAI Codex).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants