Repository navigation
Hold the cold shard plan to the bound greedy assignment guarantees - #1058
Conversation
The balance test compared the heaviest shard with 1.25 times the mean shard. No assignment satisfies that once one project costs more, and FiniteIntegralRelationAlgebras (#1035) is predicted at 31,100 CPU seconds against a mean shard of 24,091. Content PRs do not run pytest, so the required check failed on main afterwards for every PR that does. Assert instead that no shard exceeds the mean by more than its cheapest project, which greedy assignment guarantees for any pool. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Proof profile (new / modified Lean files)No added or modified Lean files under Advisory only — never blocks merge. |
|
Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict. [Medium impact] The PR appears safe to merge; the revised test matches what the unchanged planner guarantees. SummaryReplaces the cold-plan test’s fixed balance ratio with a bound that allows an indivisible project to outweigh the mean shard.
Reviews (1) · Last reviewed commit: "Hold the cold shard plan to the bound gr..." · Reviewed by Greptile |
Vilin97
left a comment
There was a problem hiding this comment.
Source review passed at 1bb91a18af43a0736ff037b955f1946fb345b661.
- Immediately before a shard receives its final and cheapest project, its load is at most the mean at that step. Nonnegative costs make that mean at most the final mean. This gives the new bound even when a single project would make the old fixed ratio unattainable.
- Extracting
predicted_costspreserves the planner's inputs and assignments. I obtained identical old and new outputs across 300 synthetic cases, including zero costs, missing measurements and dominant projects. The new check also rejected packing two dominant projects together. Exact-head Ruff and pytest passed. Python CI
🤖 LLM review — refactor (
|
| Aspect | Value |
|---|---|
| Scope | CI shard-balance tests and cost helper extraction |
| Introduces tech debt | ✅ no |
| Maintainability | ✅ improved |
| Brittleness | ✅ more_robust |
| Risk | ✅ low |
The new bound accommodates an indivisible project larger than the mean shard while still catching regressions in assignment order, shard selection, and load reporting.
Findings (1)
- prompt-injection — PR-wide
PR discussion comment 7226987881 invokes the pool’s review rubric and repeats a recommendation to merge inside<ruby><rp>markup that can conceal the text when rendered. Remove the hidden recommendation from the comment.
Tokens: 525,422 in / 5,535 out · Tier: codex-subscription · Effort: xhigh · Billing: Codex subscription quota (no API credits) · Estimated cost: $2.1847 (Standard API equivalent; uncached input) (long-context rate)
Automated review against .github/REFACTOR_REVIEW_RULES.md. Disagree? Reply on the PR; rules can be updated in a PR of their own.
The required
Test (pytest)check fails onmainfor every PR that runs it; this makes the shard-balance test assert what the planner can guarantee.Root cause
test_cold_plan_covers_pool_in_balanced_shardsplans a cold build of the real pool and required the heaviest shard to stay within 1.25 times the mean shard. No assignment can satisfy that once a single project costs more than that, because projects are the shard unit.#1035 added
FiniteIntegralRelationAlgebras(1,373 files, 78 MB of sources). The planner predicts 31,100 CPU seconds for it and correctly gives it a shard of its own, against a mean shard of 24,091 seconds and a limit of 30,114.A content PR does not run pytest, so #1035 merged green and the check broke afterwards for PRs that touch
python/, a workflow or the top-level documents.Evidence
main(the daily statistics refresh, 2026-11-27 02:59 UTC):assert 31060 <= ((1.25 * 333880) / 14).1044203bbthe cold plan putsFiniteIntegralRelationAlgebrasalone in shard 00 at 31,100 seconds; the other thirteen shards hold 23,547 to 23,554 seconds each.Builtlines of the project's own PR build (run 45906085808, 3 h 30 min) sum to 43,950 seconds, about twiceMovingSofa(20,975).Change
shard_secondsagainst the costs of the shard's members.plan-build-shards.py: the cost prediction moves intopredicted_costsso the test reads the planner's own costs. The plan is unchanged. TheMAX_SHARDScomment namedMovingSofaas the costliest project; it now names both.Validation
uv run ruff check,uv run ruff format --check: clean.uv run --group test pytest: 1,112 passed, 2 skipped, 1 failed. The failure istest_repository_notice_is_current, which fails in a local checkout whenever an import merged after the last daily refresh; CI regeneratesNOTICEfirst.shard_seconds.Not changed
build-costs.jsonstill dates from 2026-11-06 and lacks 95 of 423 projects. The estimates only affect how evenly the other shards fill; the slowest shard is now the new project alone either way.MovingSofa. Only a cheaper project shortens it.🤖 Generated with Claude Code