mirror of
https://github.com/seedds/nxnative.git
synced 2026-11-24 20:36:17 -10:00
nvn: the look-ahead admits every later draw's pipeline (PR #1344)
After a submission's first pipeline miss, the look-ahead (pso_predict_rest) handed at most two pipelines to the background (PSO_PREDICT_BUDGET, PSO_PEND_ACTIVE), a bound set without a measurement. It also held back the keys of the draws it met with their attachments as they are, although those draws come later in the same submission, so each draw with no stand-in compiled its pipeline on the submit thread, one after another. Each of those pipelines is now admitted (pso_pend_kick_next, bounded by the 384-slot table) after the same exclusions as before: a base already made (pso_base_made), a key that drew with a stand-in (g_pso_hy) and a ready pulling stand-in (hybrid_get) take nothing. Only the guesses with other depth / stencil attachments keep the bound of two. A draw whose build is still queued makes it itself (pso_pend_take). The host change of the draft PR, without its quality settings, profile and seed list. Measured cold (MTL_SHADER_CACHE_SIZE=0, no archive, prewarm lists or prebuild): FINAL FANTASY RESONANCE (the PR, M5 Max) waited 2.78-2.81 s for pipelines, worst frame 2.19-2.23 s, before and 0.74-0.79 s, worst 0.71-0.74 s, after. OCTOPATH TRAVELER II's smoke route through Hikari's opening (M4 Pro, bench.py, the hosts alternating, two runs each): 200-205 draws waited 5.0-6.0 s before, 120-128 waited 3.0-3.3 s after; median frame time unchanged, no red line. An ordered pool of 10 or 5 workers instead of the global queue waited longer (2.61-2.64 / 2.78-2.95 s against 2.50-2.53 s in one three-way run), so every build starts at once. Checked: the graphics tests (t_pso_pending with a new case), the docs test. Not run: regress.py check (the ten OCTOPATH TRAVELER II runs were its one game), FINAL FANTASY RESONANCE here (not on this Mac), iPhone. Co-authored-by: DarkDelacroix-hash <[email protected]>
This commit is contained in:
1 parent
3fabafc803
commit
960d203ecc
6 files changed
+53
-11
No files matched your search
@@ -70,6 +70,7 @@ General host changes first needed here; each applies to every game:
|
||||
- **Bindless reads through a phi that also carries non-handle values** (the vendored translator's `TryTableHandle`): [Bindless reads whose handle phi also carries other values](../../../docs/reference/shaders.md#bindless-reads-whose-handle-phi-also-carries-other-values).
|
||||
- **Buffer textures below the 16-byte alignment, read in place through an offset table** (`tbuf_lead`; an aligned copy, `tbuf_shadow`, before): [Buffer textures at offsets below 16 bytes](../../../docs/reference/rendering.md#buffer-textures-at-offsets-below-16-bytes).
|
||||
- **Buffer textures shared by storage** (`nvn_mtl.m` `tex_buffer`, `tbuf_usage`): on an iPhone 15 Pro Max, about 79,000 buffer-texture views added to and removed from the residency set every 300 frames of play, 235 ms of residency commits per 300 frames (GitHub issue #2423): [Transient buffer textures shared by storage](../../../docs/reference/rendering.md#transient-buffer-textures-shared-by-storage). Not run on this game since.
|
||||
- **The look-ahead hands every later draw's pipeline to the background** (`pso_pend_kick_next`; PR #1344, measured on an M5 Max): a cold load into Grandshelt Castle plus two menus waited 0.74–0.79 s for pipelines against 2.78–2.81 s: [The look-ahead hands every later draw's pipeline to the background](../../../docs/reference/shaders.md#the-look-ahead-hands-every-later-draws-pipeline-to-the-background).
|
||||
|
||||
## Open
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ General changes first needed here; each applies to every game:
|
||||
- **Unreal paks with inline shaders read in version 11, and Zlib / LZ4 pak blocks decoded in Python** (`uepak.py` `inline_shaders`, `Pak.read`; `shader_split.py` `ue_legacy_jobs`, `ue_inline_shaders`; `profile_guess.py` `ue_legacy`): [Unreal Engine 4.27 shaders inline in cooked packages (LZ4)](../../../docs/reference/shaders.md#unreal-engine-427-shaders-inline-in-cooked-packages-lz4).
|
||||
- **More than 64 bindings per shader** (`NVN_REFL_MAXB`, now 128): [More than 64 bindings in one shader](../../../docs/reference/shaders.md#more-than-64-bindings-in-one-shader).
|
||||
- **The precompile look-ahead restores the scissor** (`pso_predict_rest`; `DM_NVN_PREDICT=0` turns the look-ahead off): [The precompile look-ahead restores the scissor](../../../docs/reference/shaders.md#the-precompile-look-ahead-restores-the-scissor).
|
||||
- **The look-ahead hands every later draw's pipeline to the background** (`pso_pend_kick_next`): a cold run of the smoke route waited 3.0–3.3 s for pipelines against 5.0–6.0 s: [The look-ahead hands every later draw's pipeline to the background](../../../docs/reference/shaders.md#the-look-ahead-hands-every-later-draws-pipeline-to-the-background).
|
||||
- **Geometry draws above the scratch bound drawn in runs, the index compaction in three dispatches, large scratch arenas released when idle** (`geo_split`, `nvn_geometry.h`, `arena_begin`): [Geometry draws above the capture scratch bound](../../../docs/reference/shaders.md#geometry-draws-above-the-capture-scratch-bound).
|
||||
- **Recursive splits retain their original descriptor when child draws reuse the geometry job** (`geo_split`): [Recursive geometry splits retain their original draw range](../../../docs/reference/shaders.md#recursive-geometry-splits-retain-their-original-draw-range). The first-attack regression exposed an invalid index read in the job-based integration; a CPU reproduction verifies the ownership fix independently of the game.
|
||||
- **Guest primitive IDs retain the original draw's offset across compute splits**: [Split geometry primitive IDs](../../../docs/reference/shaders.md#split-geometry-primitive-ids). Found while reviewing this game's large shadow draw; the failure and fix are established with a real translated synthetic shader, independently of game-specific shader behavior.
|
||||
|
||||
+22
-11
@@ -10006,6 +10006,9 @@ static void pso_key_fill(pso_key *k, NvShader *vs, NvShader *fs, const uint32_t
|
||||
// After satisfying the first pipeline miss in a submission, scan ahead once along the remaining commands (replaying state only, no drawing) and kick a bounded number of normal-pass pipelines to the background;
|
||||
// when the submit thread reaches that draw it only waits for 'the remaining time not yet compiled'. The compiled pipelines are identical to synchronously compiled ones (same descriptor). Pipeline keys of merged passes / specialized fragments depend on the planning result at replay time, are not predicted, and are compiled synchronously as before.
|
||||
#define PSO_PEND_MAX 384
|
||||
// PSO_PEND_ACTIVE / PSO_PREDICT_BUDGET bound the guesses only (a key with another depth / stencil attachment than the draw's). The draws the scan met with their attachments as they
|
||||
// are come later in this submission, so each of their pipelines is admitted (pso_pend_kick_next), bounded by the table: bounded by 2 as well, a cold load of FINAL FANTASY
|
||||
// RESONANCE into Grandshelt Castle waited 2.8 s for pipelines, worst frame 2.2 s, against 0.74-0.79 s (PR #1344)
|
||||
enum { PSO_PEND_ACTIVE = 2, PSO_PREDICT_BUDGET = 2 };
|
||||
// order: admission order (the oldest finished, untaken entry is reclaimed first); demand: a build a draw asked for while it draws with its pulling stand-in (hybrid pipelines),
|
||||
// outside the speculative limit; run: 0 queued, 1 taken by its worker; d: the descriptor while queued (a draw that would wait for a queued build makes the pipeline itself:
|
||||
@@ -10027,7 +10030,8 @@ static int pso_pend_find(const pso_key *k) { for (int i = 0; i < PSO_PEND_MAX; i
|
||||
static int hybrid_on(void);
|
||||
// The queue of the builds hybrid draws asked for (the draw has a pulling stand-in, so nothing waits for them): serial queues at utility QoS, one per two performance cores, round
|
||||
// robin. At user-initiated QoS on the global queue, a cold start's burst (777 builds on entering Zora's Domain, Breath of the Wild) ran on every core, beside the game's own threads,
|
||||
// for the seconds it took. Speculative builds (pso_pend_kick: at most PSO_PEND_ACTIVE at a time) keep the global queue, so a demanded build never waits behind speculation
|
||||
// for the seconds it took. The prediction's builds (pso_pend_kick_next, and the guesses of pso_pend_kick: at most PSO_PEND_ACTIVE at a time) keep the global queue: they are draws
|
||||
// of this submission that would wait, and a draw that reaches its build while still queued makes it itself (pso_pend_take)
|
||||
static dispatch_queue_t pp_bg_queue(void) {
|
||||
static dispatch_queue_t q[8]; static int n; static _Atomic unsigned rr; static dispatch_once_t once;
|
||||
dispatch_once(&once, ^{ int pc = 0; size_t sz = sizeof pc; if (sysctlbyname("hw.perflevel0.physicalcpu", &pc, &sz, NULL, 0) || pc < 2) pc = 2;
|
||||
@@ -10039,8 +10043,8 @@ static dispatch_queue_t pp_bg_queue(void) {
|
||||
// 3 no pulling entry (layer-writing or transform feedback vertex shader, or no pulling library), 4 pulling base not made yet; count and time (prediction walks left out)
|
||||
static uint64_t g_pw_n[5], g_pw_ns[5];
|
||||
static const char *const g_pw_why[5] = {"hybrid off", "merged pass or readable tile", "diagnostic fragment", "no pulling entry", "pulling base not made yet"};
|
||||
// Takes a slot for k (with g_pp_mu held): a free one, else the oldest finished entry no draw took (its worker no longer touches it). spec: a speculative build, refused while
|
||||
// PSO_PEND_ACTIVE speculative builds run. Returns the slot, -1 when refused or k is in the table already
|
||||
// Takes a slot for k (with g_pp_mu held): a free one, else the oldest finished entry no draw took (its worker no longer touches it). spec: 0 a demanded build; 1 a speculative guess,
|
||||
// refused while PSO_PEND_ACTIVE speculative builds run; 2 a later draw of this submission, speculative but not refused. Returns the slot, -1 when refused or k is in the table already
|
||||
static int pso_pend_slot(const pso_key *k, int spec, uint32_t *gen) {
|
||||
int slot = -1, reclaim = -1, active = 0;
|
||||
if (pso_pend_find(k) >= 0) return -1;
|
||||
@@ -10049,7 +10053,7 @@ static int pso_pend_slot(const pso_key *k, int spec, uint32_t *gen) {
|
||||
else if (!g_pp[i].done) active += !g_pp[i].demand;
|
||||
else if (reclaim < 0 || g_pp[i].order < g_pp[reclaim].order) reclaim = i;
|
||||
}
|
||||
if (spec && active >= PSO_PEND_ACTIVE) return -1;
|
||||
if (spec == 1 && active >= PSO_PEND_ACTIVE) return -1;
|
||||
if (slot < 0) slot = reclaim;
|
||||
if (slot < 0) return -1;
|
||||
g_pp[slot].k = *k; g_pp[slot].ps = nil; g_pp[slot].d = nil; g_pp[slot].done = g_pp[slot].run = 0; g_pp[slot].used = 1; g_pp[slot].demand = !spec;
|
||||
@@ -10067,14 +10071,19 @@ static void pso_pend_start(int slot, uint32_t gen, MTLRenderPipelineDescriptor *
|
||||
pthread_mutex_lock(&g_pp_mu); if (g_pp[slot].gen == gen) { g_pp[slot].ps = ps; g_pp[slot].done = 1; } pthread_cond_broadcast(&g_pp_cv); pthread_mutex_unlock(&g_pp_mu); g_pp_done_n++;
|
||||
});
|
||||
}
|
||||
static int pso_pend_kick(const pso_key *k, NvShader *vs, NvShader *fs) { // Nonblocking admission of a speculative build: no speculative backlog in front of a demanded compile
|
||||
static int pso_pend_kick_(const pso_key *k, NvShader *vs, NvShader *fs, int spec) {
|
||||
if (hm_get_id(&g_pso, k)) return 0;
|
||||
pthread_mutex_lock(&g_pp_mu); uint32_t gen = 0; int slot = pso_pend_slot(k, 1, &gen); pthread_mutex_unlock(&g_pp_mu);
|
||||
pthread_mutex_lock(&g_pp_mu); uint32_t gen = 0; int slot = pso_pend_slot(k, spec, &gen); pthread_mutex_unlock(&g_pp_mu);
|
||||
if (slot < 0) return 0;
|
||||
PD("J pipeline source=predict key=%016llx vs=%s fs=%s depth=%u stencil=%u samples=%u", (unsigned long long)nvn_hm_hash(k, sizeof *k), vs->key, fs ? fs->key : "-", k->dfmt, k->sfmt, k->samples);
|
||||
pso_pend_start(slot, gen, pso_desc(k, vs, fs, nil, 0), !k->border, dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0));
|
||||
return 1;
|
||||
}
|
||||
// Nonblocking admission of a speculative guess: no speculative backlog in front of a demanded compile
|
||||
static int pso_pend_kick(const pso_key *k, NvShader *vs, NvShader *fs) { return pso_pend_kick_(k, vs, fs, 1); }
|
||||
// A later draw of this submission as the scan met it, which would wait for its pipeline: admitted whatever runs. Its draw takes it when built, or makes it at once while it is
|
||||
// still queued (pso_pend_take), so it never waits behind the others; the Metal compiler service builds them side by side
|
||||
static int pso_pend_kick_next(const pso_key *k, NvShader *vs, NvShader *fs) { return pso_pend_kick_(k, vs, fs, 2); }
|
||||
// The build a hybrid draw asked for while it draws with its stand-in: outside the speculative limit, on pp_bg_queue
|
||||
static int pso_pend_demand(const pso_key *k, NvShader *vs, NvShader *fs) {
|
||||
if (hm_get_id(&g_pso, k)) return 0;
|
||||
@@ -12902,16 +12911,18 @@ static void pso_predict_rest_(void) {
|
||||
state_op(hq.op, aq);
|
||||
}
|
||||
(void)df; (void)sf;
|
||||
// Main's demand-first budget: at most PSO_PREDICT_BUDGET new speculative builds. A predicted key whose base is made needs no compile (pso_base_made) and takes nothing here.
|
||||
// With hybrid pipelines a predicted draw whose pulling stand-in is ready (made here, from its base made or archived: the work its draw would do) will not wait, and builds
|
||||
// its own pipeline on demand (pso_pend_demand); the budget goes to the draws that would wait (a pair whose pulling base is not made yet)
|
||||
// Demand first: this runs after the draw's own pipeline is built. A predicted key whose base is made needs no compile (pso_base_made) and takes nothing here. With hybrid
|
||||
// pipelines a predicted draw whose pulling stand-in is ready (made here, from its base made or archived: the work its draw would do) will not wait, and builds its own pipeline
|
||||
// on demand (pso_pend_demand). The rest are draws that would wait (a pair whose pulling base is not made yet): each draw met with its attachments as they are (qa) is
|
||||
// admitted, then at most PSO_PREDICT_BUDGET guesses with other depth / stencil attachments (qb)
|
||||
int admitted = 0, hy = hybrid_on();
|
||||
for (int i = 0; i < na + nb && admitted < PSO_PREDICT_BUDGET; i++) {
|
||||
for (int i = 0; i < na + nb && (i < na || admitted < PSO_PREDICT_BUDGET); i++) {
|
||||
const pso_key *qk = i < na ? &qa[i].k : &qb[i - na].k; NvShader *qv = (__bridge NvShader *)(i < na ? qa[i].vs : qb[i - na].vs), *qf = (__bridge NvShader *)(i < na ? qa[i].fs : qb[i - na].fs);
|
||||
if (hm_get_id(&g_pso, qk)) continue;
|
||||
if (pso_base_made(qk, qv, qf)) { hm_put_id(&g_pp_easy, qk, NSNull.null); continue; }
|
||||
if (hy && hybrid_get(qk, qv, qf) != nil) continue;
|
||||
admitted += pso_pend_kick(qk, qv, qf);
|
||||
if (i < na) g_pp_admit += (uint64_t)pso_pend_kick_next(qk, qv, qf);
|
||||
else admitted += pso_pend_kick(qk, qv, qf);
|
||||
}
|
||||
g_pp_admit += (uint64_t)admitted;
|
||||
memcpy(&S, &Ssave, sizeof S); R.sc = sc0; R.has_sc = has_sc0; args_dirty_all(); g_pso_dirty = pso_dirty; g_dss_dirty = dss_dirty; prog_resolve();
|
||||
|
||||
@@ -239,6 +239,25 @@ static void test_two_active_exact_take_and_release(void) {
|
||||
reset_queue();
|
||||
}
|
||||
|
||||
// A later draw of the submission (pso_pend_kick_next) is admitted while PSO_PEND_ACTIVE guesses run; a guess still is not
|
||||
static void test_next_draws_pass_the_guess_limit(void) {
|
||||
reset_queue();
|
||||
GateDevice *dev = [[GateDevice alloc] initBlockingThrough:4 nilCall:0]; g_dev = (id<MTLDevice>)(id)dev;
|
||||
pso_key a = make_key(600), b = make_key(601), c = make_key(602), d = make_key(603), guess = make_key(604);
|
||||
EXPECT_EQ("first guess admitted", 1, pso_pend_kick(&a, test_vs, test_fs));
|
||||
EXPECT_EQ("second guess admitted", 1, pso_pend_kick(&b, test_vs, test_fs));
|
||||
if (![dev waitForEntered:2 timeoutMs:5000]) { EXPECT_TRUE("guess workers entered fake compiler", 0); [dev releaseAll]; drain_queue(5000); reset_queue(); return; }
|
||||
EXPECT_EQ("a later draw is admitted at the guess limit", 1, pso_pend_kick_next(&c, test_vs, test_fs));
|
||||
EXPECT_EQ("another later draw is admitted", 1, pso_pend_kick_next(&d, test_vs, test_fs));
|
||||
EXPECT_TRUE("the later draws compile beside the guesses", [dev waitForEntered:4 timeoutMs:5000]);
|
||||
EXPECT_EQ("a guess is still refused while builds run", 0, pso_pend_kick(&guess, test_vs, test_fs));
|
||||
EXPECT_EQ("a later draw already in the table is not admitted twice", 0, pso_pend_kick_next(&c, test_vs, test_fs));
|
||||
[dev releaseAll];
|
||||
EXPECT_TRUE("later draws complete", pending_done(&c, 5000) && pending_done(&d, 5000));
|
||||
EXPECT_TRUE("their draws take them", pso_pend_take(&c) != nil && pso_pend_take(&d) != nil);
|
||||
drain_queue(5000); reset_queue();
|
||||
}
|
||||
|
||||
static void test_full_table_reclaims_done_not_running(void) {
|
||||
reset_queue();
|
||||
GateDevice *dev = [[GateDevice alloc] initBlockingThrough:2 nilCall:0]; g_dev = (id<MTLDevice>)(id)dev;
|
||||
@@ -371,6 +390,7 @@ int main(void) {
|
||||
test_vs = [NvShader new]; test_fs = [NvShader new];
|
||||
snprintf(test_vs->key, sizeof test_vs->key, "pending-base-vs"); snprintf(test_fs->key, sizeof test_fs->key, "pending-base-fs");
|
||||
test_two_active_exact_take_and_release();
|
||||
test_next_draws_pass_the_guess_limit();
|
||||
test_full_table_reclaims_done_not_running();
|
||||
test_nil_prediction_falls_back_then_predicts();
|
||||
test_prediction_restores_scissor();
|
||||
|
||||
@@ -1314,6 +1314,7 @@ One line per symptom in the [subsystem references](../reference/): what you see
|
||||
- with Metal 4 pipelines on (the Mac; on iOS `pso_mtl4 on` or `DM_PSO_MTL4=1`), Apple's performance HUD says `Compiled 2 shaders. Total compilation time is 102.70ms. Consider adopting MTL4Compiler for more fine grained compilations` during play, when a shader with function constants loads. → [Functions with function constants specialized by the pipeline, not the library](../reference/shaders.md#functions-with-function-constants-specialized-by-the-pipeline-not-the-library)
|
||||
- a pipeline for a vertex shader that writes `render_target_array_index` cannot be built. → [Layer-writing vertex shaders get the triangle class](../reference/shaders.md#layer-writing-vertex-shaders-get-the-triangle-class)
|
||||
- the picture bright green and white from some scene on, in runs with pipelines compiled on demand (prewarm lists off or short) and in none with `DM_NVN_PREDICT=0`. → [The precompile look-ahead restores the scissor](../reference/shaders.md#the-precompile-look-ahead-restores-the-scissor)
|
||||
- on entering a new area or opening a menu for the first time, with no archive or prewarm list covering it, frames of 0.2–2 s whose `[longframe]` line is nearly all pipeline work, and `draws that waited: pulling base not made yet` in the `pipelines up to frame` lines. → [The look-ahead hands every later draw's pipeline to the background](../reference/shaders.md#the-look-ahead-hands-every-later-draws-pipeline-to-the-background)
|
||||
- a GPU frame capture (`DM_GPU_CAPTURE`, or Xcode with `MTL_CAPTURE_ENABLED=1`) fails with `Capturing Render pipeline specialization is not supported`, or the capture layer crashes on the pipeline archive; a capture of the `MTLDevice` is refused. → [GPU frame captures need pipelines built through the device](../reference/shaders.md#gpu-frame-captures-need-pipelines-built-through-the-device)
|
||||
- the first boot sat on the loading clock for about a minute, the CPU idle, with every file read done after 12 s. → [A cold Metal cache looks like a long load](../reference/shaders.md#a-cold-metal-cache-looks-like-a-long-load)
|
||||
- missing geometry or bright patches just after loading, which disappear as background pipeline compilation finishes. → [Native mesh draws omitted while their pipeline compiles](../reference/shaders.md#native-mesh-draws-omitted-while-their-pipeline-compiles)
|
||||
|
||||
@@ -2744,6 +2744,14 @@ Finding, keying and translating shaders (`dm/gfx/tools/shader_split.py`, `dmsh_b
|
||||
- **Found on:** [OCTOPATH TRAVELER II](../../dm/games/0100A3501946E000/README.md): from Castti's opening flashback and the battlefield of Hikari's opening on.
|
||||
- **Check:** found by bisecting with four runs started at once on copies of one save: `DM_NVN_PREDICT=0` fixed it, a look-ahead that compiled nothing did not, and of its parts only the state ops brought it back; four runs green before the fix, four right after it.
|
||||
|
||||
### The look-ahead hands every later draw's pipeline to the background
|
||||
|
||||
- **Symptom:** on entering a new area or opening a menu for the first time, with no archive or prewarm list covering it, frames of 0.2–2 s whose `[longframe]` line is nearly all pipeline work, and `draws that waited: pulling base not made yet` in the `pipelines up to frame` lines.
|
||||
- **Cause:** after a submission's first pipeline miss, the look-ahead (`pso_predict_rest`) handed at most two of the rest to the background (`PSO_PREDICT_BUDGET`, `PSO_PEND_ACTIVE`), a bound set without a measurement. It applied to the keys of the draws the look-ahead met, with their attachments as they are, although those draws come later in the same submission. A draw with no stand-in whose pipeline was not admitted compiled it on the submit thread, so a frame with dozens of new pipelines compiled them one after another.
|
||||
- **Fix:** each of those draws' pipelines is admitted (`pso_pend_kick_next`, bounded by the 384-slot table), after the same exclusions as before: a key whose base is made (`pso_base_made`), one that already drew with a stand-in (`g_pso_hy`) and one whose pulling stand-in is ready (`hybrid_get`) take nothing. Only the guesses with other depth / stencil attachments keep the bound of two. The draw's own pipeline is built before the look-ahead runs, and a draw whose build is still queued makes it itself (`pso_pend_take`), so none waits behind the others; the Metal compiler service builds them side by side. Host only, every game.
|
||||
- **Found on:** [FINAL FANTASY RESONANCE](../../dm/games/0100606026F12000/README.md#found-on-this-game) (PR #1344, Apple M5 Max): a save loaded into Grandshelt Castle, then the System Menu and the World Map, with no archive, lists or prebuild and the system's Metal cache off: 2.78–2.81 s of pipeline waits, worst frame 2.19–2.23 s, before; 0.74–0.79 s, worst 0.71–0.74 s, after (two runs each). Bounding all of them by 16 instead gave 1.9–2.0 s. Repeated on [OCTOPATH TRAVELER II](../../dm/games/0100A3501946E000/README.md#found-on-this-game) (Apple M4 Pro, `bench.py`, the hosts alternating, two runs each): its smoke route from the settings save through New Game and Hikari's opening, 290 s, cold the same way: draws that waited 200–205 for 5.0–6.0 s before, 120–128 for 3.0–3.3 s after; 64–70 builds admitted against 130–151; the look-ahead's own time 0.03–0.17 s either way; the longest frame in the window 1.32–1.58 s against 0.62–1.07 s (the long frames left are the game's loads, with no pipeline work); median frame time unchanged, no red line. The same builds on a fixed set of workers taking them in the draws' order, the draw making any it reached still queued, waited longer in a three-way A/B of one host (two runs each): 10 workers 2.61–2.64 s, 5 workers 2.78–2.95 s, against 2.50–2.53 s with every build started at once. Even with 5 workers almost no draw reached its build still queued, so the order was not what held the draws up; the Metal compiler service builds more of them side by side.
|
||||
- **Check:** `dm/gfx/tests/t_pso_pending.m` (`test_next_draws_pass_the_guess_limit`). Without `MTL_SHADER_CACHE_SIZE=0` a second run of the same route finds every pipeline in the system's cache and waits almost nothing either way, so cold comparisons need it, with `DM_PSO_ARCHIVE=off`, `DM_PSO_MANIFEST=off` and `DM_PSO_PREBUILD=0`.
|
||||
|
||||
### GPU frame captures need pipelines built through the device
|
||||
|
||||
- **Symptom:** a GPU frame capture (`DM_GPU_CAPTURE`, or Xcode with `MTL_CAPTURE_ENABLED=1`) fails with `Capturing Render pipeline specialization is not supported`, or the capture layer crashes on the pipeline archive; a capture of the `MTLDevice` is refused.
|
||||
|
||||
Reference in new issue
Block a user