th#1031: cell_selection_bug recovers via self-mint instead of blocking every request#371
Merged
Merged
Conversation
…locking forever A self-requested cell whose graph signature drifts from this runtime's own (cell_key has no graph-shape axis, so structurally different sdxl graphs can share one key) used to raise CellSelectionBugError straight out of fleet_cells.enable_compiled, aborting the whole arm attempt. For a mandatory w8a8/w4a4 lane that becomes CompiledLaneUnavailableError, which fails setup entirely and gets retried from scratch on the next request/job -- hitting the identical stale delivered cell again, forever. Live pod_events proves this: 54 cell_selection_bug rows across 2 releases/9 pods over 24h+ (predating pgw#622 by ~12h, so unrelated to it), all rejecting one stale signature (c3c4395265ad) that nothing was ever able to overwrite. ArmOutcome now carries the caught CellSelectionBugError; enable_compiled falls through to self-mint (the ordinary MISS recovery) instead of raising. The th#883 invariant stays wire-visible -- callers still send the cell_selection_bug ModelEvent/pod_event -- it just no longer blocks serving. Self-mint's own fail-closed safety net (no CUDA/toolchain/target) is untouched, so a genuine mint impossibility on a mandatory lane still refuses, now chained from the selection bug via __cause__. Threaded through both compile-arming seams: the worker-loaded slot path (_enable_compiled) and the self-loaded pipeline path (ArmingScope/ arm_compile, what sdxl actually uses) via a new selection_bugs map so neither silently drops the alarm. (cherry-picked from chaos 97cf56b; hand-reapplied onto master's executor.py -- chaos has unrelated indentation-changing refactors in the same function that master doesn't have yet)
PaulFidika
marked this pull request as ready for review
July 23, 2026 07:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause (confirmed against live pod_events)
Two stacked compile-cache failures, both live on
pod_events.class='cell_selection_bug':Signature mismatch is real and persistent, not caused by pgw#622. 54 rows across 2 releases (
7f57379eeab6464e96c9234c,ec4335c9700c445c09bb0c3c) and 9 pods over 24h+. The earlier release's rows start 2026-07-22 08:16 UTC -- ~12h before pgw#622 was even committed (20:10 UTC same day) -- so pgw#622 is coincidental timing, not the cause. Every row rejects the same stale published signaturec3c4395265adagainst a consistently-different consumer signature (826a1212a266, mostly).cell_key(gw#581/th#883) has no graph-shape axis, so a stale/incompatible sdxl graph can sit published under a key that a structurally-different (or since-changed) consumer legitimately never matches.cache_collisionon the hub-pushed re-adopt is a downstream symptom, not a separate bug: becauseCellSelectionBugErroraborted arming outright (fleet_cells.enable_compiledre-raised it verbatim, th#883's original "never mask it" invariant), the worker could never self-mint a corrected replacement. The hub kept re-pushing the same stale cell; each retry cycle left a fresh but non-matching local capture that later collided on adopt.Net effect: every request on the affected worker paid a full
self_mint_compile phase=warmup_forwardcycle, because the only path back to a compiled state (self-mint) was structurally unreachable from thecell_selection_bugexit.Fix
ArmOutcomenow carries the caughtCellSelectionBugError.fleet_cells.enable_compiledstill treats it as a bug (unchanged th#883 wire visibility -- callers still send thecell_selection_bugModelEvent/pod_event) but no longer aborts arming: it falls through to self-mint exactly like an ordinary miss, so the worker recovers into a working, published-and-replacing compiled state instead of retrying the identical unusable cell forever. Self-mint's own fail-closed safety net (no CUDA/toolchain/target) is untouched -- a genuine mint impossibility on a mandatory lane still refuses, chained from the selection bug via__cause__so the report is never dropped.Threaded through both compile-arming seams: the worker-loaded slot path (
_enable_compiled) and the self-loaded pipeline path (ArmingScope/arm_compile-- what sdxl actually uses) via a newselection_bugsmap on the scope.Tests
tests/test_fleet_cells.py: rewrote the invariant test (test_cell_selection_bug_propagates_untouched->test_cell_selection_bug_reports_and_self_mints) to lock in report-then-recover; addedtest_cell_selection_bug_still_fail_closed_when_mint_impossiblefor the genuine-impossibility fail-closed path.cc.enable()/cell_keytests (the lower-level primitive that still correctly raises) untouched -- this fix is purely in the fleet orchestration layer's handling of that exception.Scope
SDXL-family only in the observed pod_events (no other family shows this class). Architecturally latent fleet-wide wherever
cell_keydoesn't fully capture graph-shape compatibility -- worth a follow-up to add a graph-signature axis tocell_keyitself (bigger blast radius: invalidates every published cell fleet-wide, so deliberately out of scope for this hotfix). Filed as a follow-up note in th#1031.Full writeup:
~/cozy/cozy-creator-tracker/tensorhub/progress.mdth#1031.