GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — heavy facts: per-kind fits from the kernel ledger; kit capacity evaluator and callers by scuttletoby · Pull Request #786 · scuttletoby/t3code Conversation
Owner
What and whyDynamic slots design row D6: the kit learns to answer "may one more piece of work start here?" from the kernel, with the same capacity rule the TypeScript side uses.
Size: about 1085 lines of code (rule evaluator 412, facts 469, callers 204), over the row's ~450. The evaluator mirrors the TS rule line by line, so it cannot be shorter without dropping parts of the rule. Tests
Spot-check results (each line removed, then restored):
Run here: capacity_rule, facts, install, queue, measure (all OK), and the packages/shared capacity vitest (248 passed). General vs projectAll general: nothing names a project, host, user or path outside the user's own home config and
Dynamic slots design row D6
Not in this row (stated limits):
🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Owner
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Owner
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. …ator and callers Dynamic slots design row D6. The kit gets a Python evaluator of the shared capacity rule (lib/capacity_rule.py) that passes every vector and format case the TypeScript tests read, and `heavy facts [--kind K] [--mb N]`: one free/v1 object with per-kind "fits" from a ledger read from the kernel (heavy's live tickets plus T3's agent scopes, unlabelled = writer), a 5 s cache, the Basic tier, unreadable signals as elevated, and per-folder reservations. bin/t3-capacity and bin/agent-slots are thin callers of it that keep the older output and exit codes; a facts call that is slow (5 s) or fails is never free. Co-Authored-By: Claude Opus 5.5 <[email protected]> … and other users fail closed Fix round for the two D6 reviews. - A heavy ticket whose kind the rule does not know (tsc, gradle, a project's own) is the rule's unknownKinds.job, never an agent; heavy facts --kind with an unknown name asks for that job too. - A reservation folder matches itself and what is below it, with or without a trailing '/', never a sibling sharing its first letters; its real path matches too. The caller's own folder is its real working folder only. - Basic tier (no cgroup v2 or no user manager) is never free and fits 0. Full tier also counts every other user's heavy jobs and agent scopes from their user managers' cgroups; a folder that cannot be listed is basic. Without a cache folder every call starts "elevated". - lib/capacity_readings.py: the shared reader's port. It runs every capacity-readings.json case and the "a failed reading never admits more" check; memory, PSI, cores and container limits now come from it, a box with a live piece but no folder is unreadable, a cut-short memory.stat owes in full. - The cache has version 2 and a key of its settings; t3-capacity takes the rule's whole hold; a fill count of 2.5 asks three times, as in TypeScript. Co-Authored-By: Claude Opus 5.5 <[email protected]>
scuttletoby
force-pushed
the
fork/heavy-facts-d6
branch
from
6bdf78d to
4a8f615
Compare
… kit path The heavy kit's evaluator, its tests and heavy-install read the capacity rule from its one source, packages/shared/src/capacity, but the sparse checkouts of the workflows, action_tests and kit_tests jobs left that folder out, so install.test.py and facts.test.py found no capacity-rule.json. The folder is now in the three lists (and in the `workflows` comment that says why each app file is there). The "//" notes of capacity-rule.json and capacity-readings.json named the kit's Python files, which the fork-owned-reads lint counts as app code reading a fork-owned path; they now point to README.md beside them, which names them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
scuttletoby
added a commit
that referenced
this pull request
…top of the kit capacity check Built on the kit's `heavy facts` and its thin `t3-capacity` caller (#786) instead of a second capacity evaluator. What the older host check had that the kit's did not: - heavy.capacity.holds in the machine file: a cgroup outside the user managers (a CI runners' slice) that is in use keeps its budget less its use, as a reservation, for every user but its own. Missing file, section or key: no holds; a broken one: no answer (t3-capacity NOT OK naming the key); a changed one is read again at once (cache key). - The sweep and the queue accept the new `capacity` key. - Tests for the state question: holds in use or idle, own users, missing cgroup, unreadable memory.max or memory.stat, machine file missing/empty/garbled/writable by others/unknown key, a changed file within the cache's 5 s, a reservation file cut short, a reservation whose processes are gone; one red check. Part of #834 (G2, first half). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced
Open
Open
2 of 6 tasks
Uh oh!
There was an error while loading. Please reload this page.
Owner
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
scuttletoby
added a commit
that referenced
this pull request
#786 landed on main as one squash commit. Conflicts in fork-kit/heavy/README.md, lib/heavy_facts.py and tests/facts.test.py: main's copies are byte-identical to #786's last branch commit (3989409), which this branch builds on, so the branch's copies are kept. The PR's diff against main is now only its own commit (machine-file holds). Co-Authored-By: Claude Opus 5.5 <[email protected]>
scuttletoby
added a commit
that referenced
this pull request
…ests build the gate at START The merge of main brought the heavy kit's Python evaluator of the capacity rule (#786), written for the rule before this PR. This PR's rule counts swap by its trend (pressure.swapFillingMb; calm.swapFreeAtLeastPercent gone), so the kit read a key the shared rule no longer has (KeyError in capacity_rule.test.py and every heavy facts call). - lib/capacity_rule.py mirrors capacityPressure.ts and pressureOf: raw_level takes the last read's swap free (filling = it fell by more than swapFillingMb; nearly full counts only while filling; filling is never calm; no previous swap read = trend unknown), next_pressure keeps or starts the calm wait on an unknown trend but never ends it, and the kept state carries swapFreeMb for the next read (heavy facts' cache carries it). The shared capacity-vectors.json swap-trend cases and the facts carry test fail when any part is undone. - capacity_rule.test.py: a kit copy of the rule from before the swap trend is refused by name; an empty or missing rule file raises (heavy facts then answers "not available", never free). - agentSlotRoutes.test.ts: the gate's 30 s enforce sampler starts when the gate is built. Built at the test clock's 0, the tests' move to START ran every sample in the 56 years between (about 59 million): Test Server 5 hung until its 20 min cancel. boot now sets the clock to START first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
scuttletoby
added a commit
that referenced
this pull request
…cked on #786) (#843) * heavy facts: per-kind fits from the kernel ledger; kit capacity evaluator and callers Dynamic slots design row D6. The kit gets a Python evaluator of the shared capacity rule (lib/capacity_rule.py) that passes every vector and format case the TypeScript tests read, and `heavy facts [--kind K] [--mb N]`: one free/v1 object with per-kind "fits" from a ledger read from the kernel (heavy's live tickets plus T3's agent scopes, unlabelled = writer), a 5 s cache, the Basic tier, unreadable signals as elevated, and per-folder reservations. bin/t3-capacity and bin/agent-slots are thin callers of it that keep the older output and exit codes; a facts call that is slow (5 s) or fails is never free. Co-Authored-By: Claude Opus 5.5 <[email protected]> * heavy facts: every ticket is a job, folders match exactly, basic tier and other users fail closed Fix round for the two D6 reviews. - A heavy ticket whose kind the rule does not know (tsc, gradle, a project's own) is the rule's unknownKinds.job, never an agent; heavy facts --kind with an unknown name asks for that job too. - A reservation folder matches itself and what is below it, with or without a trailing '/', never a sibling sharing its first letters; its real path matches too. The caller's own folder is its real working folder only. - Basic tier (no cgroup v2 or no user manager) is never free and fits 0. Full tier also counts every other user's heavy jobs and agent scopes from their user managers' cgroups; a folder that cannot be listed is basic. Without a cache folder every call starts "elevated". - lib/capacity_readings.py: the shared reader's port. It runs every capacity-readings.json case and the "a failed reading never admits more" check; memory, PSI, cores and container limits now come from it, a box with a live piece but no folder is unreadable, a cut-short memory.stat owes in full. - The cache has version 2 and a key of its settings; t3-capacity takes the rule's whole hold; a fill count of 2.5 asks three times, as in TypeScript. Co-Authored-By: Claude Opus 5.5 <[email protected]> * heavy facts: kit tests check out the capacity rule; its JSON names no kit path The heavy kit's evaluator, its tests and heavy-install read the capacity rule from its one source, packages/shared/src/capacity, but the sparse checkouts of the workflows, action_tests and kit_tests jobs left that folder out, so install.test.py and facts.test.py found no capacity-rule.json. The folder is now in the three lists (and in the `workflows` comment that says why each app file is there). The "//" notes of capacity-rule.json and capacity-readings.json named the kit's Python files, which the fork-owned-reads lint counts as app code reading a fork-owned path; they now point to README.md beside them, which names them. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-kit/heavy: machine-file holds for heavy facts (t3-capacity), on top of the kit capacity check Built on the kit's `heavy facts` and its thin `t3-capacity` caller (#786) instead of a second capacity evaluator. What the older host check had that the kit's did not: - heavy.capacity.holds in the machine file: a cgroup outside the user managers (a CI runners' slice) that is in use keeps its budget less its use, as a reservation, for every user but its own. Missing file, section or key: no holds; a broken one: no answer (t3-capacity NOT OK naming the key); a changed one is read again at once (cache key). - The sweep and the queue accept the new `capacity` key. - Tests for the state question: holds in use or idle, own users, missing cgroup, unreadable memory.max or memory.stat, machine file missing/empty/garbled/writable by others/unknown key, a changed file within the cache's 5 s, a reservation file cut short, a reservation whose processes are gone; one red check. Part of #834 (G2, first half). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby
added a commit
that referenced
this pull request
) * Slot gate: enforce the capacity rule by default (dynamic slots D4) The capacity rule now decides agent starts (mode "enforce", the default when agentSlots has no mode and is switched off): - owed term: every agent still starting, held slot or waiter ahead owes its full cost, so two starts in one second both count; - kinds from the task role: research, review and design are light, anything else or no role is a writer; a light agent that grows past the light cost counts as a writer, so a wrong role cannot hide one; - floors (2 agents, 1 job) and derived ceilings (3 agents per core, at most 64); - fallback to the fixed ceilings (10 agents, 4 jobs) with start costs raised 25% per trip after an OOM kill (oom_kill in /proc/vmstat rises) or swap under 10% free; it lifts after 10 minutes of calm, whole readings. A restart starts in the fallback and at "elevated"; unreadable readings are never calm. Typed limits still apply while enabled; "mode": "fixed" turns the rule off. The delegate_task route passes its role to the slot gate with the target. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Slot gate: fix round after lenses A and B (D4) - floor always starts, also with failed, hung or out-of-range readings; after 2 minutes unread the fixed 10 counts alone - a restart lifts on calm for this host: swap counts by trend, the first calm needs the margin only; a 30 s timer takes readings - costs from the rule file (light 384, writer 768); light cost clamped - only agent-slice OOM kills raise costs; untold kills raise at most 2; each calm spell lowers one raise - basic tier (no scopes or no oom_kill) keeps the fixed 10; unread running agents count once as writers - unreadable settings use the fixed limits; true counts in refusals - tests for the held slot, the role line, no OOM counter Co-Authored-By: Claude Opus 5.5 <[email protected]> * Slot gate: kit evaluator follows the swap-trend rule; scheduled-run tests build the gate at START The merge of main brought the heavy kit's Python evaluator of the capacity rule (#786), written for the rule before this PR. This PR's rule counts swap by its trend (pressure.swapFillingMb; calm.swapFreeAtLeastPercent gone), so the kit read a key the shared rule no longer has (KeyError in capacity_rule.test.py and every heavy facts call). - lib/capacity_rule.py mirrors capacityPressure.ts and pressureOf: raw_level takes the last read's swap free (filling = it fell by more than swapFillingMb; nearly full counts only while filling; filling is never calm; no previous swap read = trend unknown), next_pressure keeps or starts the calm wait on an unknown trend but never ends it, and the kept state carries swapFreeMb for the next read (heavy facts' cache carries it). The shared capacity-vectors.json swap-trend cases and the facts carry test fail when any part is undone. - capacity_rule.test.py: a kit copy of the rule from before the swap trend is refused by name; an empty or missing rule file raises (heavy facts then answers "not available", never free). - agentSlotRoutes.test.ts: the gate's 30 s enforce sampler starts when the gate is built. Built at the test clock's 0, the tests' move to START ran every sample in the 56 years between (about 59 million): Test Server 5 hung until its 20 min cancel. boot now sets the clock to START first. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby
added a commit
that referenced
this pull request
…ator and callers (#786) * heavy facts: per-kind fits from the kernel ledger; kit capacity evaluator and callers Dynamic slots design row D6. The kit gets a Python evaluator of the shared capacity rule (lib/capacity_rule.py) that passes every vector and format case the TypeScript tests read, and `heavy facts [--kind K] [--mb N]`: one free/v1 object with per-kind "fits" from a ledger read from the kernel (heavy's live tickets plus T3's agent scopes, unlabelled = writer), a 5 s cache, the Basic tier, unreadable signals as elevated, and per-folder reservations. bin/t3-capacity and bin/agent-slots are thin callers of it that keep the older output and exit codes; a facts call that is slow (5 s) or fails is never free. Co-Authored-By: Claude Opus 5.5 <[email protected]> * heavy facts: every ticket is a job, folders match exactly, basic tier and other users fail closed Fix round for the two D6 reviews. - A heavy ticket whose kind the rule does not know (tsc, gradle, a project's own) is the rule's unknownKinds.job, never an agent; heavy facts --kind with an unknown name asks for that job too. - A reservation folder matches itself and what is below it, with or without a trailing '/', never a sibling sharing its first letters; its real path matches too. The caller's own folder is its real working folder only. - Basic tier (no cgroup v2 or no user manager) is never free and fits 0. Full tier also counts every other user's heavy jobs and agent scopes from their user managers' cgroups; a folder that cannot be listed is basic. Without a cache folder every call starts "elevated". - lib/capacity_readings.py: the shared reader's port. It runs every capacity-readings.json case and the "a failed reading never admits more" check; memory, PSI, cores and container limits now come from it, a box with a live piece but no folder is unreadable, a cut-short memory.stat owes in full. - The cache has version 2 and a key of its settings; t3-capacity takes the rule's whole hold; a fill count of 2.5 asks three times, as in TypeScript. Co-Authored-By: Claude Opus 5.5 <[email protected]> * heavy facts: kit tests check out the capacity rule; its JSON names no kit path The heavy kit's evaluator, its tests and heavy-install read the capacity rule from its one source, packages/shared/src/capacity, but the sparse checkouts of the workflows, action_tests and kit_tests jobs left that folder out, so install.test.py and facts.test.py found no capacity-rule.json. The folder is now in the three lists (and in the `workflows` comment that says why each app file is there). The "//" notes of capacity-rule.json and capacity-readings.json named the kit's Python files, which the fork-owned-reads lint counts as app code reading a fork-owned path; they now point to README.md beside them, which names them. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby
added a commit
that referenced
this pull request
…cked on #786) (#843) * heavy facts: per-kind fits from the kernel ledger; kit capacity evaluator and callers Dynamic slots design row D6. The kit gets a Python evaluator of the shared capacity rule (lib/capacity_rule.py) that passes every vector and format case the TypeScript tests read, and `heavy facts [--kind K] [--mb N]`: one free/v1 object with per-kind "fits" from a ledger read from the kernel (heavy's live tickets plus T3's agent scopes, unlabelled = writer), a 5 s cache, the Basic tier, unreadable signals as elevated, and per-folder reservations. bin/t3-capacity and bin/agent-slots are thin callers of it that keep the older output and exit codes; a facts call that is slow (5 s) or fails is never free. Co-Authored-By: Claude Opus 5.5 <[email protected]> * heavy facts: every ticket is a job, folders match exactly, basic tier and other users fail closed Fix round for the two D6 reviews. - A heavy ticket whose kind the rule does not know (tsc, gradle, a project's own) is the rule's unknownKinds.job, never an agent; heavy facts --kind with an unknown name asks for that job too. - A reservation folder matches itself and what is below it, with or without a trailing '/', never a sibling sharing its first letters; its real path matches too. The caller's own folder is its real working folder only. - Basic tier (no cgroup v2 or no user manager) is never free and fits 0. Full tier also counts every other user's heavy jobs and agent scopes from their user managers' cgroups; a folder that cannot be listed is basic. Without a cache folder every call starts "elevated". - lib/capacity_readings.py: the shared reader's port. It runs every capacity-readings.json case and the "a failed reading never admits more" check; memory, PSI, cores and container limits now come from it, a box with a live piece but no folder is unreadable, a cut-short memory.stat owes in full. - The cache has version 2 and a key of its settings; t3-capacity takes the rule's whole hold; a fill count of 2.5 asks three times, as in TypeScript. Co-Authored-By: Claude Opus 5.5 <[email protected]> * heavy facts: kit tests check out the capacity rule; its JSON names no kit path The heavy kit's evaluator, its tests and heavy-install read the capacity rule from its one source, packages/shared/src/capacity, but the sparse checkouts of the workflows, action_tests and kit_tests jobs left that folder out, so install.test.py and facts.test.py found no capacity-rule.json. The folder is now in the three lists (and in the `workflows` comment that says why each app file is there). The "//" notes of capacity-rule.json and capacity-readings.json named the kit's Python files, which the fork-owned-reads lint counts as app code reading a fork-owned path; they now point to README.md beside them, which names them. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-kit/heavy: machine-file holds for heavy facts (t3-capacity), on top of the kit capacity check Built on the kit's `heavy facts` and its thin `t3-capacity` caller (#786) instead of a second capacity evaluator. What the older host check had that the kit's did not: - heavy.capacity.holds in the machine file: a cgroup outside the user managers (a CI runners' slice) that is in use keeps its budget less its use, as a reservation, for every user but its own. Missing file, section or key: no holds; a broken one: no answer (t3-capacity NOT OK naming the key); a changed one is read again at once (cache key). - The sweep and the queue accept the new `capacity` key. - Tests for the state question: holds in use or idle, own users, missing cgroup, unreadable memory.max or memory.stat, machine file missing/empty/garbled/writable by others/unknown key, a changed file within the cache's 5 s, a reservation file cut short, a reservation whose processes are gone; one red check. Part of #834 (G2, first half). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby
added a commit
that referenced
this pull request
) * Slot gate: enforce the capacity rule by default (dynamic slots D4) The capacity rule now decides agent starts (mode "enforce", the default when agentSlots has no mode and is switched off): - owed term: every agent still starting, held slot or waiter ahead owes its full cost, so two starts in one second both count; - kinds from the task role: research, review and design are light, anything else or no role is a writer; a light agent that grows past the light cost counts as a writer, so a wrong role cannot hide one; - floors (2 agents, 1 job) and derived ceilings (3 agents per core, at most 64); - fallback to the fixed ceilings (10 agents, 4 jobs) with start costs raised 25% per trip after an OOM kill (oom_kill in /proc/vmstat rises) or swap under 10% free; it lifts after 10 minutes of calm, whole readings. A restart starts in the fallback and at "elevated"; unreadable readings are never calm. Typed limits still apply while enabled; "mode": "fixed" turns the rule off. The delegate_task route passes its role to the slot gate with the target. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Slot gate: fix round after lenses A and B (D4) - floor always starts, also with failed, hung or out-of-range readings; after 2 minutes unread the fixed 10 counts alone - a restart lifts on calm for this host: swap counts by trend, the first calm needs the margin only; a 30 s timer takes readings - costs from the rule file (light 384, writer 768); light cost clamped - only agent-slice OOM kills raise costs; untold kills raise at most 2; each calm spell lowers one raise - basic tier (no scopes or no oom_kill) keeps the fixed 10; unread running agents count once as writers - unreadable settings use the fixed limits; true counts in refusals - tests for the held slot, the role line, no OOM counter Co-Authored-By: Claude Opus 5.5 <[email protected]> * Slot gate: kit evaluator follows the swap-trend rule; scheduled-run tests build the gate at START The merge of main brought the heavy kit's Python evaluator of the capacity rule (#786), written for the rule before this PR. This PR's rule counts swap by its trend (pressure.swapFillingMb; calm.swapFreeAtLeastPercent gone), so the kit read a key the shared rule no longer has (KeyError in capacity_rule.test.py and every heavy facts call). - lib/capacity_rule.py mirrors capacityPressure.ts and pressureOf: raw_level takes the last read's swap free (filling = it fell by more than swapFillingMb; nearly full counts only while filling; filling is never calm; no previous swap read = trend unknown), next_pressure keeps or starts the calm wait on an unknown trend but never ends it, and the kept state carries swapFreeMb for the next read (heavy facts' cache carries it). The shared capacity-vectors.json swap-trend cases and the facts carry test fail when any part is undone. - capacity_rule.test.py: a kit copy of the rule from before the swap trend is refused by name; an empty or missing rule file raises (heavy facts then answers "not available", never free). - agentSlotRoutes.test.ts: the gate's 30 s enforce sampler starts when the gate is built. Built at the test clock's 0, the tests' move to START ran every sample in the 56 years between (about 59 million): Test Server 5 hung until its 20 min cancel. boot now sets the clock to START first. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | |||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |