Repository navigation
Conversation
7f2ebc4 to
94ac132
Compare
…ce, and a failed archive no longer fails the build metal-tt on an M1 (applegpu_g13g) failed the whole archive with 'Max Unstruct ID N ... in shader M exceeds supported limit' (LNPANDY/NX2Apple#98). M is the backend's job counter, not an index into the script, so pso_offline.py finds the bases that fail alone by halving the script, drops them, builds the rest (at most three rounds), and leaves their pairs to the device (rest_pairs.tsv, archive.tsv). The rejected set is part of the archive's key. The NSP script and build_ipa.sh pack the app without an archive when pso_offline.py fails (--pso-strict / DM_PSO_STRICT=1 fail instead); the stage ends with a warning.
94ac132 to
9e8da64
Compare
…led archive is a warning: the app is packed without one instead of the build stopping (PR #494) More than 1,000 bases are compiled in sequential groups and merged with metal-pack; --batch-size 0 keeps one compiler run. Odyssey's 32,864 bases for applegpu_g13g on a 16 GB Mac: one run 690 s and 636 s with swap rising from about 5 GB to 22 GB; groups 315 s, swap at most 5.7 GB, an archive 1.8% larger. A host of that chain found all 16 bases it probed in a merged g18g archive. Opening a merged archive on an iPhone is not tested. The PR's search for bases the compiler rejects is not taken: the two Max Unstruct ID 642 lines of the M1's report are notes from one base, which compiles alone with exit 0, and the full script exits 0 with the same two lines. Front-ends: interface: a build whose pipeline archive fails now exits 0 with an app without one: its stage_end has warn: true and a [RED] say line follows (on an IPA build only the say line); the app builds the bases on its first start. Co-authored-by: v0lumehi <34629096+v0lumehi@users.noreply.github.com>
|
Landed part of this on main as c0e150f, with you credited as co-author. Thanks! Taken: a failed archive no longer stops the build. The app is packed without one, with a Not taken: the search for rejected bases. You had flagged the message as maybe not being the cause, and testing here supports that. Using the reporter's chain (
So the search would have narrowed down to that base and found nothing to drop. Likely cause: memory. The attached log has only those notes and Not tested: a merged archive on an iPhone, and this change on an 8 GB Mac or the reporter's M1. |
…led archive is a warning: the app is packed without one instead of the build stopping (PR seedds#494) More than 1,000 bases are compiled in sequential groups and merged with metal-pack; --batch-size 0 keeps one compiler run. Odyssey's 32,864 bases for applegpu_g13g on a 16 GB Mac: one run 690 s and 636 s with swap rising from about 5 GB to 22 GB; groups 315 s, swap at most 5.7 GB, an archive 1.8% larger. A host of that chain found all 16 bases it probed in a merged g18g archive. Opening a merged archive on an iPhone is not tested. The PR's search for bases the compiler rejects is not taken: the two Max Unstruct ID 642 lines of the M1's report are notes from one base, which compiles alone with exit 0, and the full script exits 0 with the same two lines. Front-ends: interface: a build whose pipeline archive fails now exits 0 with an app without one: its stage_end has warn: true and a [RED] say line follows (on an IPA build only the say line); the app builds the bases on its first start. Co-authored-by: v0lumehi <34629096+v0lumehi@users.noreply.github.com>
What and why
Reported in LNPANDY/NX2Apple#98:
--platform mac-appfor Super Mario Odyssey 1.4.1 on an M1 (applegpu_g13g) stops at the pipeline archive, and with it the whole build:[RED] pso_offline: metal-tt failed for applegpu_g13g (exit 1): Max Unstruct ID 642 in function agc.main in shader 13566 exceeds supported limit(andshader 15729), thenair-tt: applegpu-nt command failed. The archive is an optimization; without it the app builds its pipelines on its first start.shader Nis not an index into the script. It is a job counter of the backend: a script of P pipelines uses 0 to 3P - 1, three per pipeline, in an order that changes between runs (checked withmetal-tton small scripts; one bad pipeline gives two messages). The failing base cannot be read off the number.What is not known. With AIR-TT 32023.921 the same message is only a note on G13/G14 (synthetic functions at
Max Unstruct ID801 and 3009 ong13g,g13s,g13d,g14g,g14s: exit 0, archive written; none ong15gand later), as the existing entry for Odyssey's758/642says. Why the reporter's run exits 1 with only those lines is not established (another toolchain version, or a function whose own failure prints nothing else); the real Odyssey libraries were not available. So the change does not depend on the message being the cause:pso_offline.py: whenmetal-ttfails and its log has the limit message, the bases that fail alone are found by halving the script (the messages of a half are counted, so a half holding all of them settles the other without a run; at most 160 runs), dropped, and the archive is built of the rest (at most 3 rounds, then it fails as before). Their pairs go intorest_pairs.tsv(the device builds them, as for function constants),archive.tsvlists them, and the console prints[RED] pso_offline: <arch>: N bases the compiler rejects (...) left to the device. Any other failure, or the message with no base that fails alone, stays fatal forpso_offline.py.rejected.<arch>.tsv); a key that does not match starts again from every base, so a compiler that accepts them rebuilds with them.build_ipa_from_nsp.py(Mac app) andbuild_ipa.sh(IPA): ifpso_offline.pystill fails, the build warns ([RED]line, the log's last lines, the stage ends with a warning:⚠in the console,warn: truein the JSON event, not✗) and packs the app without an archive.--pso-strict/DM_PSO_STRICT=1fails instead (CI, regress).Workaround without this change:
--gpu none(orPSO_GPUS = 'none').Run time (from the code, not observed): a base the host cannot build is
[RED] failed to create render pipeline, remembered ing_pso_fail, and its draws are skipped unless a stand-in covers them. Whether the run-time compiler on an M1 rejects the same Odyssey shader is assumed.Checked
test_pso_offline(newRejected: two named bases dropped, archive of the rest, rejected listed inrest_pairs.tsv/archive.tsv; one base per run takes rounds, and the round limit; other failures and the message with no failing base stay fatal; search budget; key changes with the rejected set, and a new toolchain starts again),test_nsp_mac_app(failed archive is a warning and the app is packed without it; strict fails;run(fatal=False)),test_nsp_progress(warn stage end), alltest_nsp_*,test_docs,test_ci_toolchain,test_shader_regressions. The newpso_offlinetests fail onupstream/main's file.metal-tt(AIR-TT 32023.921,g13g) with axcrunwrapper that turns the note into exit 1, 12 synthetic bases of which 2 are over the budget: both found (2 rounds of runs, 11 s in all), archive of the other 10,rest_pairs.tsvwith the two pairs, reused on the second run.lint_python.py0 new.build_ipa.sh(shell change read, not run),regress.py(no game builds on this machine).Docs
docs/reference/shaders.mdentry, andpython3 dm/tools/docs_symptoms.pywas run (the symptom index)