Skip to content

feat(kyty): say at start which KYTY_* variables this build does not read - #235

Open
Celegans12 wants to merge 1 commit into
simnJS:AnyKytyfrom
Celegans12:feat/warn-unread-kyty-variables
Open

Celegans12 wants to merge 1 commit into
simnJS:AnyKytyfrom
Celegans12:feat/warn-unread-kyty-variables

Conversation

@Celegans12

@Celegans12 Celegans12 commented Nov 22, 2026 •

Copy link
Copy Markdown

What

A KYTY_* variable this build doesn't read changed nothing and said nothing: a switch removed after its A/B, or a misspelt KYTY_NATIVERT=0, ran with the default while the tester reported numbers for the setting.

  • KytyShim/src/Settings.cpp holds one sorted list of every KYTY_* name the code under core/ reads: the shim's options, the Kyty core's own reads, KYTY_AB, KYTY_AB_START, KYTY_AB_SETTLE and the runtime switch table, kyty_gpu.prx's PGO writer and libkernel's KYTY_DIRECT_MEMORY_PAGES. A static_assert keeps it sorted and free of duplicates.
  • Libs::Graphics::Initialize calls Settings::ReportUnread right after the host report, in the plain and the DLL build. It reads the process environment (GetEnvironmentStringsA on Windows, environ on Linux) and prints [kyty] KYTY_FLAT_DEFER is set but not read by this build once per unread name, in name order, once per process. The Kyty options listed under "What AnyKyty does not read" in ANYKYTY_SETTINGS.md get the same line; known names print nothing.
  • tools/check_kyty_settings.py skips that file in its scan and now also fails when the list and the names the code reads differ (either way), when a name is listed twice, or when a listed name is one that "What AnyKyty does not read" names. --names and --ignored-doc point it at other files for its tests.
  • THIRD_PARTY_KYTY.md, ANYKYTY_SETTINGS.md and START_HERE.md say a new name goes into the list too, and describe the line.

#224 also edits check_kyty_settings.py (the tuple literals() yields, and the prefix rule); the new listed() unpacks either tuple size, so the two merge in any order. #220 adds an include next to the new one in EntryGpu.cpp.

Tested

Windows 11, kyty_gpu DLL with llvm-mingw 20261104 (next8 PGO profile), host side with MinGW-w64 GCC 15.2.0: libs, relinker and the shim test targets build; check_kyty_settings and the 14 kyty_shim_* tests pass. New: kyty_shim_settings (known, removed, misspelt and ignored names, order, duplicates) and kyty_shim_settings_environment (ctest sets KYTY_SETTINGS_TEST_UNREAD=1 and KYTY_HDR=0: one line for the first, none for the second, nothing on a second call). Linux (WSL Ubuntu 24.04, GCC 13.3): the same test passes in both modes, as do the 17 cases of test_check_kyty_settings.py and the check. The new Python cases fail on the AnyKyty checker; the C++ test doesn't compile there.

Ghost of Yōtei 1.008 (PPSA26344), RTX 3080 Laptop, 120 s at the Teshio save with KYTY_KV_SANITY_UNREAD=1 added to our usual settings: the log has [kyty] KYTY_KV_SANITY_UNREAD is set but not read by this build once, right after the host report, and no line for the KYTY_* names this build reads (KYTY_ASYNC_PIPELINES, KYTY_GPU_SPIN_US). It also caught a real one: our run script still sets KYTY_TRACE_BRINGUP=1, which no code reads, and that got its line too.

Checklist

  • Based on current AnyKyty (b372daf454a); no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: Fixes kyty: say at start which KYTY_* variables this build does not read #211
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3080 Laptop GPU, driver 621.14, Windows 11
  • AI-assisted: yes

@simnJS simnJS added enhancement New feature or request area: tools-ci Tests, CI, measurement and analysis tools labels Nov 22, 2026
@simnJS

simnJS commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Thanks, this is a clean design: one sorted list checked at compile time, one line per unread name, and the checker keeps the
list honest in both directions. We looked for false positives (names built at run time, the runtime switch table, the helper
readers in Config.cpp, Faults.cpp and pipelineLibrary.cpp) and found none.

We can't take it in tonight's integration because it no longer passes on the current AnyKyty (b372daf454). Your base is
3f7863d6a4, and #243 has since added KYTY_F32_PRODUCT_NO_CONTRACTION. After a cherry-pick:

error: KYTY_F32_PRODUCT_NO_CONTRACTION is read at core/kyty/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp:622 but is
not in the list of read names in core/libs/prx/libSceAgcDriver/KytyShim/src/Settings.cpp

so the check_kyty_settings test would turn red. Could you rebase on the current AnyKyty and add the name? If #243's
follow-up that removes that setting lands first, the name goes away again; the checker will tell you either way. Then it goes
into the next integration.

A removed switch or a misspelt name such as KYTY_NATIVERT=0 changed
nothing and said nothing, so a tester could report numbers for a
setting that never applied.

KytyShim/src/Settings.cpp now holds the sorted list of every KYTY_*
name the code under core/ reads. Right after the host report, the
shim prints "[kyty] <name> is set but not read by this build" once
for each other KYTY_* variable in the process environment, including
the Kyty options AnyKyty documents as not read.

tools/check_kyty_settings.py skips that file in its scan and fails
when its list and the names the code reads differ, when a name is
listed twice, or when a listed name is one ANYKYTY_SETTINGS.md says
is not read. kyty_shim_settings covers the list and the lines.
@Celegans12
Celegans12 force-pushed the feat/warn-unread-kyty-variables branch from b3b825f to bbfecc3 Compare November 23, 2026 00:02
@Celegans12

Copy link
Copy Markdown
Author

Rebased onto b372daf454a and added KYTY_F32_PRODUCT_NO_CONTRACTION to the list: check_kyty_settings.py now reports 87 settings with no mismatch, its tests pass (19), and the conventions check is clean.

AI-assisted: yes

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

Labels

area: tools-ci Tests, CI, measurement and analysis tools enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kyty: say at start which KYTY_* variables this build does not read

2 participants