docs(code-index): plan graph-rebuild receipt speed - #1568
ScriptedAlchemy wants to merge 5 commits into
Conversation
A retryable graph activation used to erase the prepared serving candidate, and an unfinished clone-fingerprint successor withheld the same seat after exact and lexical owners were ready. Keep the candidate in both cases so search can move off the predecessor while graph retries. Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
The 90s receipt stays. The plan cuts clone-fingerprint replay off that predicate instead of raising the timeout after the seat fix. Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
The prove command must match the module path and fail when the filter matches nothing. Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
|
Cross-link / collaboration notePlan aligns with Mac sample + #1562 prove (seat match, search hits, edge_count 0 = no-call fixture, fail ~93.7s). Also open:
Please keep this PR docs/plan-only until #1562 lands, then open implementation commits on a fresh branch off master+#1562. No merge from this comment. |
Pstack shows the 90s spent on status fingerprint capture and clone-body serde, not edge projection. Keep the timeout. Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
|
Closing as stale. Evidence from the triage: git diff --stat origin/master...origin/cursor/graph-rebuild-speed-plan-a983 = docs/plans/graph-rebuild-receipt-speed.md +195 PLUS the 3 files of b80dd58, i.e. doc-only once #1562's fix is attributed to #1562; merge-base 918 behind Reopen with a rebase if the remaining value is wanted. |
Draft. Do not merge. Do not raise the 90s receipt.
The seat-swap commit versus master is #1562 (
b80dd58). This PR does not change that behavior. Interim pstack reorders the cuts. Full text:docs/plans/graph-rebuild-receipt-speed.md.Outcome
90 seconds is not too short for the predicate. The window is spent twice. The wait helper busy-polls status (~16k calls) and each poll recaptures a fingerprint. The workers spend CPU on clone-body JSON, canonical rewrite, and token deserialize. Edge projection is not the burn.
edge_count0 with 98305 symbols is the no-call fixture. Cut that work and make the readiness check cheap.seated_generation_age_secondsis seal age (status.rs:296), not time since the serving swap. At ~89s the generation has existed for almost the whole receipt and line 176 still has not returned. Seat match and search hits are not the predicate.Pstack, mapped to tip
Poll. The wait is
yield_nowwith no sleep (graph_rebuild_status_test.rs:171), on 4 worker threads (:248). ~16k fulltracedecay_statuscalls fit in 90s. Compact status still builds branch diagnostics before the include flag (status.rs:331-335) and opens gix viacurrent_branch(branch.rs:107-117). The named capture isGitMetadataFingerprintV1::capture(identity.rs:166-176): gix open, HEAD read, hash of loose refs, used byready_without_stat(reconcile.rs:540-562).dashboard_freshnessmust not open git (serving_reads.rs:243-245). A readiness poll returns the last ladder.Workers. Not
collect_edge_evidence. Every callable is tokenized before the 30-token exclusion (clone_body.rs:157-185, exclusion at:229). Tokens are cloned into the payload (clones.rs:413-443), serde-encoded, and rewritten bycanonicalize_json_into(partitioned_codec.rs:1230-1236, named incanonical_json.rs:654). The successor deserializes them again (clone_census.rs:46-49,clone_successor.rs:440-458).Ranked changes
Do not amend #1562. Do not touch graph publication on this evidence.
Readiness poll must not recapture a fingerprint. Stop compact status from calling
build_branch_diagnostics/current_branch. Status freshness does not callGitMetadataFingerprintV1::capture. A sleep in the test loop is optional only after the capture is gone. Estimate: a 2–5ms gix open times 16k is 30–80s of the receipt, on the same 4 threads that are sealing. Largest cut that does not change indexed bytes.Do not tokenize, serialize, or canonically rewrite a body under 30 tokens. Count or bound the body before
rename_fieldsand before retaining token vectors. An excluded body stores eligibility and the span. It never entersfrom_extracted, the file-segment JSON, orcanonicalize_json_into. Eligible bodies keep V16. No new layout. Estimate: this fixture is 98305 one-line functions, and pstack says that is the worker CPU. The fix(code-index): diagnose graph-rebuild timeout and withhold a lagging seat #15571024/2305walk was walking these payloads. If they are not sealed, that body loop is empty. Real clones stay.Successor off the receipt only if a payload remains.
serving.rs:3212-3217, guard drop atmount.rs:1168-1173, search wake atquery_runtime.rs:718-720. The ~200s page-walk estimate (2305/1024) only matters if row 2 did not delete it. Do not ignore graph indashboard_terminal_status.What lands where
b80dd58. Land row 1 first so the next sample is not 16k captures. Row 2 in that PR only if the sample still shows clone-body serde.Success criteria
Same 90s. The interim pstack already ordered the rows. After row 1:
captureorcurrent_branchunder status: row 1 is incompletecanonicalize_json_into, clone-body serde, or token deserialize: row 2publish_verified_snapshotwith graph notready: only then look at graphPass means the second wait returns,
code_graph_servingisready, the probe path is in search results, both reopen waits return inside their own 90s, and nothing editsRECEIPT_TIMEOUT,GRAPH_BACKGROUND_OPERATION_BUDGET, orACTIVATION_RETRY_BACKOFF_FLOOR.Checklist