Skip to content

Config: warn about xcl.toml keys and tables XCL does not know - #1171

Open
emirduran707 wants to merge 1 commit into
xcl-dev:mainfrom
emirduran707:config-unknown-keys
Open

emirduran707 wants to merge 1 commit into
xcl-dev:mainfrom
emirduran707:config-unknown-keys

Conversation

@emirduran707

@emirduran707 emirduran707 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

xcl.toml is read with serde's defaults, which skip keys Config does not have. A typo (pls_md = 512), or a setting put under a table of its own, had no effect, and nothing said so.

config::unknown_keys returns a file's top-level keys and tables that Config does not know. The known keys come from serializing Config::default(), so the struct stays the only list of them. xcl run reads the file's keys with it and prints one warning per unknown key, after the data: line. Config::load_or_create keeps its signature, which other code calls (e.g. #759). Unknown keys are still not an error, so existing files keep working. The tables mounts, aliases and stub_returns take any key and are not checked inside.

What is in it

  • crates/xcl/src/config.rs: unknown_keys; test unknown_keys_and_tables_are_reported. It checks a typo and an unknown table, and that the file XCL writes itself and the keys the README and the file header name report nothing.
  • crates/xcl/src/launcher.rs: the warning.
  • README.md: one sentence in the "Title data" item.

Tested

  • AMD Radeon RX 9060 XT (driver 32.0.31044.16), Ryzen 5 5600, Windows 11 Pro 26300, Rust 1.100.0; tests debug, smoke release
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4 on a74e351 (rebased onto main de36462): 1003 passed, 2 failed, 45 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record)
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3) fail identically on unmodified main de36462 on this GPU (seeds 722 and 1599).
  • the new test fails with unknown_keys returning nothing (what serde did before: left: [], right: ["d3d12", "pls_md"]); with the change cargo test -p xcl --lib config passes, 16 passed

Regression run

main:

xcl-smoke v1
commit: de36462e0b1043b915a418d4591ed1e397622ede
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1500 (PresentX 1500)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18920 MB

this PR:

xcl-smoke v1
commit: a74e3513c2d17c8a27efc1aefe5af9969d990a04
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1527 (PresentX 1527)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 21934 MB

Not tested

  • The warning on a real title's xcl.toml with a typo: the smoke run's file has none.
  • A key typed by mistake under [mounts], [aliases] or [stub_returns] is still accepted without a warning.
  • NVIDIA and Intel GPUs.

AI use

  • Claude Code with Claude Opus 5.5: found the problem, wrote the change, the test and this description; I reviewed the diff and ran the tests and smoke runs above.
  • Claude Code with Claude Opus 5.5: rebased the change onto main de36462 (a conflict in config.rs and launcher.rs; both additions kept) and reran the suite and smoke runs above.

🤖 Generated with Claude Code

@thehollowedone

Copy link
Copy Markdown

Independent Windows launcher check on 47efa2e and b393f32. Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, release.

I built with cargo build --offline --locked --release --workspace and ran the bundled synthetic title with xcl run <test-title> -- --hello, using a separate data root per build. The config set keyboard_mouse = false, included the typo pls_md = 512, and put debug in an unknown [d3d12] table. Main emitted no unknown-setting warnings. The PR emitted one each for d3d12 and pls_md. Both kept the known keyboard/mouse value and the manifest's 2048 MiB PLS quota. Both completed 50 title checks with zero failures, and the title folder and both config files kept their original hashes.

Synthetic title only. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the comparison and drafted this report.

@emirduran707

Copy link
Copy Markdown
Contributor Author

Pushed b07f906: Config::load_or_create keeps its signature (#759 calls it and would no longer build); xcl run now reads the file's unknown keys with config::unknown_keys itself. The warnings are the same. Reran the suite and the smoke run on b07f906 and updated the description. Thanks for the check, @thehollowedone.

AI-assisted (Claude Code, Claude Opus 5.5).

@futurepro62

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head b07f906 (on its base 47efa2e).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: unknown_keys_and_tables_are_reported.

Not tested

  • AMD, a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

Config is deserialized with serde's default behaviour, which skips keys
it has no field for. A typo (`pls_md = 512`) or a setting written under
a table of its own (`[d3d12]`) therefore did nothing, and the user was
not told.

unknown_keys() compares the file's top-level keys with the ones Config
serializes, so the known-key list stays the struct itself; serde
attributes on Config (and with them its error messages and boot.json)
are unchanged. `xcl run` reads the file's keys with it and prints a
WARNING line per key next to the other startup lines; load_or_create
keeps its signature, which other callers use. Unknown keys stay
non-fatal, so existing files keep working. Keys inside mounts, aliases
and stub_returns are free-form and are not checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

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