Repository navigation
Conversation
Reconcile is a row of steps from bytes to bytes, and each parsed both documents for itself: twelve whole-document parses for one write, 23 s of a 77 s settled re-run of 600 pages. Five of them served steps that only read the stored document or needed no tree at all. - The transplant's pairing and the final comparison share one parse of the stored document. The carries between them copy parts of the stored tree into the new one, so they keep a parse of their own. - The id substitution reads the document's ids off the raw bytes instead of parsing it before and after it patches. - The PersistentId carry is skipped for a document that does not hold the bytes of a binary PersistentId element; only a workflow does. The old Reconcile is kept as reconcileInPasses and compared byte for byte, with the verdict, on every PedApp unit against itself, a rebuild with new ids, rebuilds with properties left out, and the reverse: 2,214 comparisons. A workflow-shaped pair covers the PersistentId path the fixture does not. Not reading ids under arrays, and always skipping the carry, each fail the tests. A script changing all 600 pages, run with the previous binary and this one, leaves 1,719 byte-identical units. Settled page re-run: 74.3 s -> 61.6 s. Refs #2160 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011oK82u4HRCKfX2BBvhgsNm
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refs #2160 — the reconcile, the last of the three parts of the settled page re-run.
This is in the identity code (ADR-0008), so the change is deliberately narrow and the old path is kept for comparison.
What was slow
canon.Reconcilewas 23 s of a 77 s settled re-run of 600 pages, about 38 ms for each rebuilt page compared with its stored unit.Reconcile is a row of steps from bytes to bytes, and each parsed both documents for itself: twelve whole-document parses for one write.
CarryTranslationsTransplantIDs: pairingTransplantIDs: checking the substitution (ids before and after)CarryPersistentIDsCarryUnexpressedEqualThe change
parseStored,transplantIDs,equalToStored).elementIDSetOf) instead of parsing the document before and after it patches.PersistentIdcarry is skipped for a document that does not contain the bytes of a binaryPersistentIdelement. Only a workflow's elements have one, and a pair needs it on the new side.What was deliberately not done
Parsing each document once and handing the trees to every step. The translation carry and the unexpressed carry copy parts of the stored tree into the new one, so a shared stored tree could be changed under the steps after them, and the new document changes between steps. Those two carries keep a parse of their own.
Evidence
reconcileInPasses: every PedApp unit against itself, against a rebuild with new ids throughout, against rebuilds with properties left out, and the reverse, with and withoutContentsOwnTranslations— 2,214 comparisons, same bytes and same verdict. The test asserts it covered unchanged and changed verdicts and reconciles that rewrote the contents.PersistentId.elementIDSetOfagainst parsing on every unit, as stored, rebuilt and thinned.PersistentIdcarry fails three tests. A first attempt at the second control did not compile and printed nothing, and was redone.Same machine, interleaved, one run each. The microflow and entity re-runs are unchanged within noise (6.9 s / 7.0 s and 5.7 s / 5.5 s).
Not done
Generated by Claude Code