fix(vk): count every program not translated, past the 30 lines that name them #423
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!423
Loading…
Reference in a new issue
No description provided.
Delete branch "mooki/Longshot:fix/network-log-count"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: fix · Risk: low · Tested on: macOS 26.7.1, Apple M4 Max (game-free checks, no game run) · Needs: Windows or Linux, AMD or Intel GPU
Why
The log's
vk: prepared N shader programs (... M failed ...)can count more failed programs than the log ever names orcounts anywhere. Each "not translated" line stops after 30 programs, so the rest are invisible. On a Mac start,
70 failednamed 31 programs: 30 networks left out on purpose and 1 stage that did not parse. The other 39, networks pastthat line's 30, appeared nowhere. A reader of the log cannot tell a deliberate exclusion from a real failure.
How to reproduce
Seen on: macOS 26.7.1, Apple M4 Max, MoltenVK (a game start's
longshot_log.txt). The caps are the same code onevery OS, so any start with more than 30 programs failed for one reason shows it.
Settings and switches: defaults.
Steps: start the game on main where programs are left out (on a card without the movie-upscaler networks: not NVIDIA)
and read
longshot_log.txtaftervk: prepared N shader programs (... M failed ...). Game-free:python -I -B tests/test_not_translated_counts.py --cxx clang++ --source <a tree of main>.Expected: every failed program counted under a reason, the counts adding up to M.
Actual:
70 failednamed 31 programs (30 networks and 1 stage that did not parse); the other 39 appear nowhere. Thetest on main:
FAIL: vk_shader.cpp: no count of every program each "not translated" line stands for.What changed
Each of the four "not translated" reasons now has a counter that counts every program, past the 30 the log names, and
the preparation logs one count line per reason right after its
preparedline. The lines add up to thefailedcount;the per-program lines and their cap of 30 are unchanged.
++ < kFailNamedsites invk_shader.cpp, withshader_fail_lines.gpu/vk/vk_shader.cpp.st_failed:st_left_out,st_not_translated,st_mesh_not_translatedandst_stage_failed, pluskFailNamed = 30.static std::atomic<int>caps of the four "not translated" lines:translate_into'scatch (network left out, and anything else),
translate_mesh_into's catch, andseed_stage_failed. Each counter isthe one its line is capped by, so it counts every failure the line stands for, past the 30 too.
st_failedcounts lands in exactly one of them. A seed_compute trial answer is in none, as before.shader_fail_lines()(vk_shader.cpp, declared invk_shader.h) logs one line for each counter that countedanything, for example:
vk: not translated, a network left out on this card: 69 programs (the first 30 named at trace level). The lines add upto M. Each says where its programs are named: the networks' per-program lines are trace lines, hidden at the default
level, so their count line says "at trace level"; the other three say "above".
prepare_run(gpu/vk/vk_draw.cpp) calls it right after itspreparedline.[trace]), their text and their cap of 30 are unchanged.tests/test_not_translated_counts.py(new).seed_stage_failed, the counters andshader_fail_linesfrom the source and runs themagainst small stand-ins.
seed_compute only tries.
no failure it expects no line.
prepare_runlogs the lines right after its own.tests/test_log_levels.pyreads the network's cap by its new name (st_left_out++ < kFailNamed). Its check isthe same: a network left out is a trace line with a count of its own.
lines. Logging the counts again at quit was left out to keep this to the preparation's own line.
Measurements
Verdict: fixed, and nothing else moves: the new test fails on main and passes here, and the full game-free suite
changes only by that test (532 passed against main's 531, the same 32 failures and 17 skips). A log fix: nothing to
time.
Commits: main
6c9edffe5d(2026-11-14); this PR fix/network-log-count @1b2b686615.Hardware: Apple M4 Max (16 CPUs), macOS 26.7.1, Apple clang 21. Game-free: no GPU, no game
Scene: none (a log fix; its proof is the test, as CONTRIBUTING's
fixrow allows)Method:
tests/test_not_translated_counts.pyagainst main'sgpu/vk/vk_shader.cppandvk_draw.cpp(git show) andagainst this PR; the full game-free suite on both
How to reproduce:
python -I -B tests/test_not_translated_counts.py --cxx clang++(add--source <a tree of main>for main's side)6c9edffe1b2b6866tests/test_not_translated_counts.pytests/run_all.py --jobs 6)The count lines the test expects, after 30 trace lines, 30 lines, 2 lines and 1 line naming the programs:
Screenshots: none; nothing on screen changes.
Flags and settings
None.
Testing
Tested:
tests/test_not_translated_counts.pyfails on main and passes here.tests/test_log_levels.pypasses.1b2b6866and main6c9edffe.test_not_translated_counts,absent on main, passes here.
requests, some are checks main added or changed since
5e072fc8):test_appimage_package_retry,test_appimage_player_build,test_collect_wide,test_control,test_cpm_discovery,test_crash_dialog,test_crash_record,test_env_on,test_game_layout,test_lift_cleanup_error,test_linux_preflight,test_longshot_ctl,test_low_memory_notice,test_make_game_cache,test_mem_gate,test_mem_gate_children,test_mirror_trim,test_oot_state_tap,test_pcache_header_read,test_pipeline_cache_file,test_pipeline_cache_save,test_pipeline_play_cache,test_pipeline_tour,test_prof_symbols,test_program_cache_cleanup,test_program_cache_one_variant,test_readback_late,test_report_run,test_split_giants,test_vk_pgo,test_vram_budget_row,test_walk_key.recorder_sync_test.exe-2026-11-14-180744.ips).
gpu/vk/vk_shader.cppandgpu/vk/vk_draw.cppwith the renderer's flags (nx2/build.py), Appleclang 21, arm64 and x86_64.
environ(vk_shader.cpp) andposix_fallocate(pipeline_cache_file.h).
aa95d35f, at155b6f11(1b2b6866before the rebases ontoe090cc48andaa95d35f):Sweep3's checks of this head (the C/C++ it changes compiled, and its own tests run, on arm64 and x86_64 where they
apply) gave the same results as before;
python -I -B tests/run_all.pyon wave S1's merge11a5b4e7, which carriesthis head: 568/22/17 (passed/failed/skipped) against main aa95d35f's 543/33/17 on this Mac, no new failure
(
reports/2026-11-15-rebase-sweep-3.md).Not tested:
std::atomic<int64_t>,logfand a lambda, as thecode around it does.
program cache format and no draw affected. A start with any failed program shows the new lines right after
vk: prepared ….Must be tested:
155b6f11) and mainaa95d35f, start each once tothe title and read
longshot_log.txtaftervk: prepared …, expecting this PR's log to addvk: not translated, a network left out on this card: N programs (the first 30 named at trace level)(and a line for each other reason thatcounted) right after it, the count lines adding up to that line's
failed, and main's log to have no such lines (byhand: test request T-R6CX).
Risks
What could break: low. The only output added is up to four log lines after the preparation's. The counters are
64-bit atomics where the caps were 32-bit ones, so the caps can no longer wrap.
Turning it off: revert the commit.
Compatibility:
vk_shader.cppis one of the translator stamp's files (nx2/translator_files.pysince main's #370),so the first start after updating translates every program again, as any change to that file does. Saves, the options
file and the vk ABI are unchanged.
Checklist
Everyone
type(scope): description) of the status line's type.main: onaa95d35f(#761, 2026-11-15), head155b6f11, without a conflict; this PR's owncommits, old → new:
e0c1ec62→2feca0bb,1b2b6866→155b6f11; the commit names elsewhere in this descriptionare from before the rebase.
python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). On macOS: 532 passed, 17skipped, and 32 failures that also fail on main
6c9edffeon this Mac, named under Testing. After the rebase onto mainaa95d35f(head155b6f11): wave S1's merge11a5b4e7, 568/22/17 against main aa95d35f's 543/33/17, no new failure.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened.3b67e9faf61b2b686615WIP: fix(vk): count every program not translated, past the 30 lines that name themto fix(vk): count every program not translated, past the 30 lines that name them1b2b6866159488e28a5f9488e28a5f155b6f117aView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.