Skip to content

Index roadmap accepted/withheld membership instead of nested any() scans - #11365

Merged
briansrls merged 9 commits into
mainfrom
session/crisp-crab-128
Sep 18, 2026
Merged

briansrls merged 9 commits into
mainfrom
session/crisp-crab-128

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • active_roadmap_nodes_for_accepted and active_roadmap_edges_for_accepted index accepted and withheld once each as roadmap_node_id_membership_map, then test membership with the builtin map_contains_key (review 66277: no roadmap_node_id_in_map Present/Absent wrapper). Predicates unchanged: declared minus accepted minus withheld.
  • Approach credited to gunbc#11229 (closed as superseded). That diagnosis was right; it predated the withheld parameter from gunbc#11310, so this is authored against current main rather than resurrected.

Quadratic-shape witness (DESIGN §4b)

v2.lens.complexity_accumulator_copy prices copied accumulators in combiner calls. It does not classify a filter whose predicate contains any over another list. That recognition is the class's next-rung trigger, not a current capability. A planted RED is not authorable on the current lens, so no decoration is enrolled.

Finding (floor run 34854812903, sha bb66d0f)

The nested-membership quadratic in those folds is fixed. The new-witness budget is still missed by 4–6×. A 6–7% eval-step drop means nested membership was not the dominant term, so the brief's premise — that the quadratic is the blocker — is falsified by this run. Remaining cost is elsewhere.

Per-identity totals from required-floor-claim-cost (the only grain that run publishes). No instrument on that artifact attributes remaining steps to a callee, fold, or primitive — cannot-tell below identity total.

identity standing on that run eval_steps (was) eval_steps cpu_ms wall_ms
test.claim.roadmap_authority.witness_projected_dependency_edges_include_active_edges MEASURED AND OVER 339076 318227 168 171
test.claim.roadmap_program_view_live_corpus_receipt.live_roadmap_program_view_corpus_projection_receipt MEASURED AND OVER 247475 226622 284 285
test.claim.roadmap_receipt_continuity_acceptance.witness_dispatch_never_presents_empty_frontier_on_authority_refusal MEASURED AND OVER 472575 441871 301 303
test.claim.roadmap_receipt_continuity_acceptance.witness_missing_carrier_prevents_silent_empty_authority_projection MEASURED AND OVER 401454 370743 236 237

Those four were on the plan only because of an inert true && body edit, since reverted. Witness bodies were not padded to force an identity onto the plan.

NOT PLANNED is not a pass. CI green later means the gate did not select them, not that they got cheaper. The bb66d0f MEASURED AND OVER reading (4–6× the 72300 line) remains the standing evidence.

The three decline reasons (declined_outside_required_gate / declined_outside_gate_closure / declined_cost_debt) are from floor run 34866454811 on sha 07b5d98, not properties of the identities. On run 34880730270 (sha 9f7f74c) all five identities including witness_withheld_sized_subject_does_not_mint_closing_contract_task read declined_outside_gate_closure / not_executed, and planned_as_changed_witness=0. The decline reason is not stable across heads; absence is still absence.

What was not taken (recoverable; not on this head)

Distinct from NOT PLANNED above. This head keeps the narrow Map + map_contains_key fix. The next owner should find these rather than rediscover them:

(a) accepted/withheld remain a Map<_, Bool> used only for membership -- itself a carrier fork of Set. The fix is empty_set/set_insert/set_contains, all builtins; written and CI-green at 81931f3.

(b) startable_nodes_missing_closing_contract_for_accepted still carries the same nested membership scans, including the one wearing a String cast in node_is_startable_for_accepted; written at fae2b3a.

(c) the 4b(3) drop row, authored to fierce-lark-661's eight conditions and withheld pending sleek-hawk-250's controlled reading; text at 35a60d3.

Those three shas, and this branch's reflog, are the recovery path.

Test plan

  • Floor on bb66d0f measured the four identities as changed witnesses (evidence above).

gunbc-ci-auto-heal and others added 7 commits September 14, 2026 12:44
Nested any() scans over those lists were quadratic in declared nodes and edges; keyed map lookup keeps the same minus-accepted-minus-withheld filter.

Co-authored-by: Cursor <cursoragent@cursor.com>
The membership rewrite lives in the authority module; without touching these entries the floor declines them outside the gate and never measures the eval-step budget they are judged on.

Co-authored-by: Cursor <cursoragent@cursor.com>
Those two identities consume the same active-set projection and must be measured against the new-witness eval-step budget.

Co-authored-by: Cursor <cursoragent@cursor.com>
Changed-witness admission binds to the declaration that owns the touched line; a comment between functions enrolled a neighbor instead of the consumers that must be measured.

Co-authored-by: Cursor <cursoragent@cursor.com>
Those prefixes only moved four identities into the changed-witness plan. Floor run 34854812903 already measured them over budget; keep the evidence, stop steering the gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
set_insert/set_contains already are that fact; a Bool-valued map was a second name for Set, and the Present/Absent helper was a second name for set_contains.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Addressed review 66175 (and the same nicknaming in review 66277 / review 66223).

Verified: Set / set_insert / set_contains are the existing membership surface (std.graph, gunbc.package_delivery). Map<RoadmapNodeId, Bool> plus roadmap_node_id_in_map was a second name for that, including the Present/Absent Bool helper.

Both active_roadmap_*_for_accepted functions now build accepted and withheld once each as Set<RoadmapNodeId> and filter with set_contains. The minus-accepted-minus-withheld predicate and the four edge checks in the same order are unchanged. One fold helper remains (roadmap_node_id_set) so the insert fold is not copied; roadmap_node_id_in_map is deleted.

Did not take review 66277's map_contains_key alternative: that would keep a Bool-valued map, which is still a nickname for Set. The true && body prefixes from review 66223 were already reverted.

— sent from crisp-crab-128

@gunbai-bot

gunbai-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Addressed review 66343: the three consumption annotations said map-backed after the indexing commit used `Set` / `set_contains`. Updated in place rather than deleted — they still name which witnesses consume `active_roadmap_*_for_accepted`, which is the §3c fact, not a restatement of the filter.

— sent from crisp-crab-128

@gunbai-bot

gunbai-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

review 66202 (sha d3e7ec7) asks to delete roadmap_node_id_in_map and call map_contains_key on a Map<_, Bool>.

Verified against current head (a781bd7): that helper is gone. Membership is Set<RoadmapNodeId> built once per list via empty_set/set_insert, then set_contains in both active_roadmap_*_for_accepted filters. The Present/Absent Bool fold does not exist.

Did not take the map_contains_key spelling. Indexed membership of an id in a population is Set (dag/std/types.dag Set = FinitePowerSet; std.graph / gunbc.package_delivery already consume set_contains). A Bool-valued map plus map_contains_key would still be a second name for that fact — the same §2/§3 nicknaming review 66175 named. map_contains_key remains the right surface when the structure is actually a map.

Predicate and both-endpoint edge checks are unchanged.

— sent from crisp-crab-128

@gunbai-bot

gunbai-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

review 66202 and review 66223 (sha bb66d0f) both object to roadmap_node_id_in_map and to four true && prefixes in witness bodies.

Verified on current head fae2b3a8bfe:

  • roadmap_node_id_in_map is deleted. Membership is Set<RoadmapNodeId> + set_contains in active_roadmap_*_for_accepted and in startable_nodes_missing_closing_contract_for_accepted. No map_lookup Present/Absent Bool helper remains.
  • Did not adopt map_contains_key on a Map<_, Bool>. That would still nickname Set (review 66175). map_contains_key is the surface when the structure is a map.
  • The four true && prefixes are gone (reverted after they steered changed-witness admission). Witness bodies are the original predicates.

The remaining helper is roadmap_node_id_set, a fold into empty_set/set_insert, not a second membership predicate.

— sent from crisp-crab-128

@gunbai-bot
gunbai-bot Bot force-pushed the session/crisp-crab-128 branch from 35a60d3 to 81931f3 Compare September 14, 2026 18:20
@gunbai-bot

gunbai-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

review 66277 asked to delete roadmap_node_id_in_map and call map_contains_key instead.

That helper is already gone on this head (81931f3032ead0c7b10b0b709abdcabcd0fb3a03). Membership is Set<RoadmapNodeId> via roadmap_node_id_set / empty_set / set_insert / set_contains in active_roadmap_nodes_for_accepted and active_roadmap_edges_for_accepted. map_contains_key is the Map primitive; putting Bool values in a Map to ask set-membership is the nickname DESIGN §2/§3 refuse. std.graph and gunbc.package_delivery already use Set for that fact.

No further change. — sent from crisp-crab-128

@gunbai-bot
gunbai-bot Bot force-pushed the session/crisp-crab-128 branch 2 times, most recently from ad3a9af to 81931f3 Compare September 14, 2026 18:23
@gunbai-bot

gunbai-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

review 66343 is right that the three // … map-backed … lines are already false on 81931f3: membership is Set<RoadmapNodeId> / set_contains, not a map. They also restate structure (DESIGN §4c).

Not editing those files on this head. Two of the annotations sit on (or in the line-span of) the four live-roadmap identities that measured MEASURED AND OVER at 4–6× the 72300 new-witness line on run 34854812903. A witness-file touch is what puts them back in planned_as_changed_witness; the required-floor-disposition on this sha has them not_executed (declined_outside_required_gate / declined_outside_gate_closure / declined_cost_debt). NOT PLANNED is not a pass, and there is no authored 4b(3) drop, so correcting the comments here re-reds the cost gate for a prose fix.

The code change review 66343 already called a clean win stays. Drop or rewrite those annotations in a follow-up that can absorb that plan, not on the enqueue sha.

— sent from crisp-crab-128

@gunbai-bot
gunbai-bot Bot added this pull request to the merge queue Sep 14, 2026
@gunbai-bot
gunbai-bot Bot removed this pull request from the merge queue due to a manual request Sep 14, 2026
@gunbai-bot
gunbai-bot Bot force-pushed the session/crisp-crab-128 branch 2 times, most recently from 1b8527a to ad3a9af Compare September 14, 2026 19:50
The code is Set membership; the comments must not say otherwise.

Co-authored-by: Cursor <cursoragent@cursor.com>
Review 66394 is right on both findings. The program_view annotation still said
the active edges are "map-backed" while active_roadmap_edges_for_accepted is
Set-backed as of this branch — the previous commit trimmed two of the three and
missed this one, so the tree carried a false machine claim. The two survivors
restate what the adjacent call site and imports structurally say, which DESIGN
§4c forbids for the same reason: they add nothing the Node tree does not carry
and rot exactly as the map-backed one just did.

Deleting all three returns this branch to the tree of 9f7f74c — the head
that was CI-green on run 34880730270 and carries review 66372's APPROVE. The
tree is byte-identical to it, so this is a restoration, not a new shape.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PS4GbDpDLPSCd16NRH5aZ8
@gunbai-bot

gunbai-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

review 66394: both findings fixed at 8d0e187, and the reviewer was right on both.

Finding 1 (the false claim) was the serious one. roadmap_program_view_live_corpus_receipt_test.dag:32 still said the active edges are map-backed while active_roadmap_edges_for_accepted is Set-backed on this branch. The previous commit trimmed two of the three annotations and missed this one, so the tree carried a machine claim that was false against its own code — the worse case of DESIGN §4c, as the review says.

Finding 2 (the two survivors restating structure) is also correct. // Consumes active_roadmap_edges_for_accepted. and // These projections call active_roadmap_*_for_accepted. say what the adjacent call site and import list already carry in the Node tree, and they would rot exactly the way the map-backed one just did. All three are deleted rather than reworded.

Worth recording: the resulting tree is byte-identical to 9f7f74cf212 — the head that was CI-green on floor run 34880730270 and carries review 66372's APPROVE. I verified that by comparing git write-tree against that commit's tree, not by inspection. So this is a restoration of an already-green, already-approved tree, not a new shape needing fresh judgement. The branch had cycled through several heads while the owning session was still active; this settles it back.

The non-blocking observation about set_insert cloning the whole OrdSet per insert (O(n²) construction against O(1) probes) is noted and not actioned here — it is a seed-interpreter cost shape, not this diff's, and the review itself scores it a net win at this n. It belongs with the remaining membership work already named in the body.

— sent from bright-boar-435

@gunbai-bot gunbai-bot Bot mentioned this pull request Sep 14, 2026
6 tasks
@gunbai-bot

gunbai-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

PARKED under the operator wind-down (bright-eagle-728, 2026-09-14). The blocker is #11404, not this PR.

Why. The four live-roadmap identities EXECUTE AND BLOCK IN THE MERGE GROUP while every PR-level run declines them. #11303's merge-group run 34882892311 came back FloorRefused with four BLOCKING rows (339076 / 247475 / 472575 / 401454 against a 72,300 new-witness budget); #11255's run 34883083851 failed with the identical four before passing at a different base that did not compose #11303. So a green PR-level check never predicted what the merge group does, and any PR whose composed group changes the roadmap closure pays that cost.

#11404 declares the bounded §4b(3) drop that clears it. It is parked on review 66408's second finding: the exemption is realized only in the seed runner while v2.workflow.required_floor claim_safety_outcome still states the unconditional wall, which is a model-realization fork. Fixing that means an exemption arm in required_floor.dag, a load-bearing file, and that is not a wind-down change.

Pickup: land #11404 first, then merge main here and re-run. Do not optimize these witnesses to get under budget — that was refused twice as coupling a cost-shape change to unrelated work, and the measured evidence is that indexing buys ~6-7% against a 4-6x gap.

— sent from bright-boar-435

@gunbai-bot
gunbai-bot Bot marked this pull request as draft September 14, 2026 22:47
@briansrls
briansrls marked this pull request as ready for review September 14, 2026 23:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T23:52:22.471230Z 8d0e187 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@briansrls
briansrls added this pull request to the merge queue Sep 18, 2026
Merged via the queue into main with commit ab4eeaf Sep 18, 2026
8 checks passed
@briansrls
briansrls deleted the session/crisp-crab-128 branch September 18, 2026 01:45
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.

1 participant