Skip to content

Fix select by ensuring each request has at least one token - #1318

Merged
merrymercy merged 3 commits into
mainfrom
fix-select
Sep 3, 2024
Merged

merrymercy merged 3 commits into
mainfrom
fix-select

Conversation

@merrymercy

@merrymercy merrymercy commented Sep 3, 2024 •

Copy link
Copy Markdown
Collaborator

@merrymercy
merrymercy merged commit 1e495e0 into main Sep 3, 2024
@merrymercy
merrymercy deleted the fix-select branch September 3, 2024 13:31
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
… body, not the text

Measured false positive, caught by the guard failing on its own subject:
weg2_uncached_extent's docstring says 'Deliberately NOT here:
available_size(), free slot counts, time.monotonic()' -- so a source-text
grep for those terms reports the PROHIBITION as a violation. The check now
walks the AST with the docstring excluded, and the shared helper says why
in its own docstring so the next author does not reintroduce the grep. Same
class as the two reverted sgl-project#1318 pins: check the thing, not the prose about
the thing.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
…rough choose() with one rung -- Q6 boot-killer

Boot weg2sn6a (Q6, 2026-09-10 07:33Z) died in choose_host_ledger:
  TypeError: price() got an unexpected keyword argument 'ring_provenance'
The --pin-ledger-arm-m path priced the pinned arm with a hand-copied
host_ledger.price(...) call that carried choose()'s keywords
(ring_provenance, slab_reclaimable_bytes, cg_ceiling_source, cg_oom_kill),
none of which price() accepts. No test exercised the call; the desk gate was
green (NEW=0) and the union tests too.

Fix: ONE ledger_kw block for the ladder and the pin; the pin calls
host_ledger.choose(..., arms=[(1, M)]) so the pinned arm is scored by the
identical model (slab term, reap bound, W20/W21), and a refusal is re-raised
as W87 with the ladder's own reason. ARM PINNED line kept.

Tests: the source-literal pin test (asserted 'host_ledger.price(' in the
launcher text -- assert-on-a-literal, it passed on the broken code) is
replaced by (1) an AST signature-conformance ratchet over EVERY
host_ledger.<fn>( call in the launcher (red on the broken code: unknown
['ring_provenance', 'slab_reclaimable_bytes', 'cg_ceiling_source',
'cg_oom_kill']) and (2) a behavioural test that records choose()'s arms
through the real choose_host_ledger with a synthetic meminfo/cgroup.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 10, 2026
… longer prove

TestWeg2dk5WouldHaveBeenNamedBeforeItBooted was named for "the arm that died is
still refused". That sentence stopped being true at sgl-project#1318, and the test's own
comments said so while still asserting a launch-leftover number instead. The
reap currency moves that number again (+2.70 -> +14.70), so the choice was to
edit a constant a third time or to pin what the suite can actually prove.

MEASURED ATTRIBUTION of weg2dk5's death (2026-09-07 21:15:30Z), all from that
boot's own instruments rather than from this tree:

  measured non-reclaimable  94.80 GiB (anon 42.16 + shmem 52.65,
                            memts_weg2_weg2dk5.csv 21:15:30Z; cg_current 95.93)
  predicted run peak        83.66 GiB at dk5's own arm and ring table
  gap                       11.14 GiB, decomposed without residue:
    5.10 GiB tmpfs page store   -> sgl-project#1236 put it on a ZFS directory, so it is
                                   page cache/ARC and no longer shmem in this
                                   cgroup (BOOT_weg2dk5_0907.md: "the store held
                                   5.1 GiB in tmpfs ... tmpfs is shmem")
    7.68 GiB interleave anon    -> C19 charges Sigma H (32.19 GiB) once in place
                                   of image + flip transient (38.63 + 9.97), and
                                   the anon delta that killed dk5 was exactly
                                   that transient (+8,056,452 kB across memts
                                   21:15:20 -> 21:15:30, with shmem FLAT)
  reconstruction            82.02 GiB, 1.64 GiB BELOW the prediction, so the
                            ledger errs conservative on the box that died.

dk5 died in the RUN moment (flip epoch 9, waking D's weights_2, 7 min 47 s after
launch and after ten served requests) in a NON-RECLAIMABLE class, with page
cache at 28.2 MiB. The launch-side currency change therefore cannot be what
makes its arm fundable -- the two removed terms are.

THE SAFETY PROPERTY: the arm is fundable only because both terms are gone, so
the test fails if either returns -- a tmpfs (shmem) store charged into this
cgroup, or a residency model charging image + transient instead of one Sigma H.
The PRE-C19 form is deliberately not asserted: it cannot be priced at all now
(W20 "the host weights term has no measured source ... there is no third
option"), which is a missing-source refusal and would pin nothing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] device-side assert triggered when using run_batch

1 participant