Repository navigation
packing: the shader step's progress follows it past the last shader - #2684
UserDerezzed wants to merge 1 commit into
Conversation
On a build that restores every shader from the cache, the shader step's line stopped just short of its total (42,811 of 42,848 for Ocarina of Time) for about two minutes: ShaderWatch read only dmsh_build.py's progress file, written at most every half second, and after the last shader dmsh_build.py writes the library images and runs c1_guard.py and cb_extent.py (95 s on an M3 Max) with no more progress. ShaderWatch now follows those steps without a change to dmsh_build.py, a chain input: an image being written (<library>.img.part, its bytes so far), then, once the progress file is removed in a full build, c1 bounds until dmsh_build.py prints its c1_full.tsv: line and uniform read extents until its cb_extent.tsv: line (run's on_line). A --seen-shaders build makes no tables and shows none. Checked with test_nsp_mac. Not run: an iOS build (two library images).
Please stop responding to my PRs with unhelpful and nagging replies, thank you. The maintainer is fully capable of reviewing these pull requests themself. |
…2684) After the last regular shader, dmsh_build.py wrote no more progress to DMSH_PROGRESS, leaving ShaderWatch frozen at a stale ~99% count through mesh-library compilation, library-image publishing, and the c1_guard.py and cb_extent.py table passes. ShaderWatch also mapped every step other than cache check back to compiling, hiding compiling RT library. Have dmsh_build.py report all of its phases directly through DMSH_PROGRESS: flush the final counts of cache check and compiling, flush immediately on step changes, report compiling mesh libraries across _mesh, pass an optional on_progress callback through publish_library to shader_lib.write for writing the library image (or writing the Mac / iOS library image on dual-image builds, with file counts and bytes written), and report c1 guard and uniform read extents before unlinking DMSH_PROGRESS at exit. Simplify ShaderWatch to forward step, counts, unit, and formatted byte notes straight from DMSH_PROGRESS. Regenerate dm/gfx/nvn/dmsh_chain.h. Checked: 159 tests across test_nsp_mac, test_shader_lib, test_shader_toolchain_cache, test_nsp_chain, test_dmsh_abi, test_dmsh_code_fp, test_pr_areas, test_usage, and test_docs; ruff check (0 new findings). Co-authored-by: UserDerezzed <25561419+UserDerezzed@users.noreply.github.com>
|
Thanks @UserDerezzed for tracking down why the shader progress line appeared frozen near 99% after the last shader! Landed on Checked with unit and documentation tests covering single-image Mac builds, dual-image iOS builds, partial ( |
… and seedds#3156 reverted first (on main in its own form / superseded by seedds#3174); chain 6cc6fc49af97 -> 3fe2e3787fdf Conflicts, both sides kept: - hle_nvn.c: main's deferred acquire wait (c17a549, acq_wait bound to the sync) takes the batch's acquire fence (seedds#1847's 81c6189: the image's own last present, pfence, snapshotted with the ticket under acq_mu; DM_NVN_ACQ_FENCE=last the old one) as aw->gpu_fence, and DM_NVN_FRAME_LAG's wait at the acquire's start; the present notes the lag ring before publishing its ticket, and @lag_ms stays beside main's atomic @wait_ms / @pq_wait_ms. nvn_obj.h win_t has pfence and pending_acq. - nvn_mtl.m: the pool cache keeps seedds#1847's last-hit entry in front of main's 64 KB region table (a359f9e); ubd_conflict_scan's partial look walks main's buffer binding list (e49e481). - shader_lib.py: seedds#2140's shared payloads with main's on_progress (seedds#2684). - hle_fs.c: the profile's RomFS files beside main's releasable mounts (seedds#3217). - game.py (main's mem_map_limit default), pack_app.py (--tweaks and --mesh-pairs), env_switches.tsv, frame-rate.md, services.md, Ocarina's note: both entries. - dm/host/tests/Makefile: t_crash_diag (new on main) links memstat.m, which seedds#2261's GPU share line makes use IOKit: -framework IOKit. Chain header is main's (dmsh_chain.py --header agrees); symptom index, game-patches.md and env_switches.tsv order regenerated.
…eedds#2684) After the last regular shader, dmsh_build.py wrote no more progress to DMSH_PROGRESS, leaving ShaderWatch frozen at a stale ~99% count through mesh-library compilation, library-image publishing, and the c1_guard.py and cb_extent.py table passes. ShaderWatch also mapped every step other than cache check back to compiling, hiding compiling RT library. Have dmsh_build.py report all of its phases directly through DMSH_PROGRESS: flush the final counts of cache check and compiling, flush immediately on step changes, report compiling mesh libraries across _mesh, pass an optional on_progress callback through publish_library to shader_lib.write for writing the library image (or writing the Mac / iOS library image on dual-image builds, with file counts and bytes written), and report c1 guard and uniform read extents before unlinking DMSH_PROGRESS at exit. Simplify ShaderWatch to forward step, counts, unit, and formatted byte notes straight from DMSH_PROGRESS. Regenerate dm/gfx/nvn/dmsh_chain.h. Checked: 159 tests across test_nsp_mac, test_shader_lib, test_shader_toolchain_cache, test_nsp_chain, test_dmsh_abi, test_dmsh_code_fp, test_pr_areas, test_usage, and test_docs; ruff check (0 new findings). Co-authored-by: UserDerezzed <25561419+UserDerezzed@users.noreply.github.com> (cherry picked from commit d2939c1)
What and why
On a build that restores every shader from the compile cache, the shader step's progress line stops just short of its total (
42,811 of 42,848for Ocarina of Time) and stays there for about two minutes before the step ends. It looks like a hang.ShaderWatchreads onlydmsh_build.py's progress file, which is written at most every half second, so its last count can be up to half a second old. A reuse build finishes a few dozen shaders in that time. After the last shader,dmsh_build.pywrites the library images and then runsc1_guard.pyandcb_extent.py(95 s for Ocarina of Time on an M3 Max), and writes no more progress.ShaderWatchnow follows those steps without any change todmsh_build.py, which is a chain input:<library>.img.part), it showswriting the library imagewith the bytes so far.dmsh_build.pyremoves the progress file, it showsc1 bounds (c1_guard.py)untildmsh_build.pyprints itsc1_full.tsv:line.uniform read extents (cb_extent.py)until thecb_extent.tsv:line. The lines come fromrun'son_line.A
--seen-shadersbuild makes no tables, so it shows no table steps.Reference entry: The shader step stands at 99% for minutes before it ends.
Checked
Tests:
dm/tools/tests/test_nsp_mac.py(test_shader_watch_follows_the_steps_after_the_last_shader,test_shader_watch_partial_build_has_no_tables,test_the_build_follows_dmsh_builds_lines). The whole ofdm/tools/tests: 1,589 tests, one failure:test_tree_tarPackQuiet, which fails the same onmain5a4e23a2.Game: Ocarina of Time
0400486024DEC000v131072, M3 Max (36 GB), macOS 27.2,--platform mac-app, on my branch that carries this commit with other PRs. I watched the first build after a chain change, which translated every shader. After the last shader, the line showed:writing the library imageup to 10.7 GB, for 2:38;c1 bounds (c1_guard.py)for 23 s;uniform read extents (cb_extent.py)for 64 s;A build that restores every shader from the cache wasn't watched. It runs the same steps in the same order.
regress.py: not run. Only the progress line changes.dm/tools/lint_python.py --against origin/mainwith the pinned ruff 0.17.2 and pyright 1.1.414 (Python 3.14): 0 new findings.Not run: an iOS build (two library images).
Docs
docs/reference/packing.mdentry (and the game note's "Found on this game"), andpython3 dm/tools/docs_symptoms.pywas run (the symptom index)