L2 gets an exit criterion, because the measurement gave it one - #256
Closed
milyin wants to merge 2 commits into
Closed
L2 gets an exit criterion, because the measurement gave it one#256milyin wants to merge 2 commits into
milyin wants to merge 2 commits into
Conversation
The L2 section was a by-file checklist written before any of the stage was looked at, and it carried the map's default assumption: that some sites must stay because they inspect types the adapter synthesized. Instrumenting ensure_entry across every in-tree example says otherwise. TypeSubject::Adapter has two members, both manufactured by the syntactic peeling L2 deletes: MaybeUninit<Payload>, which the model absorbed into RefMode::Out and which resolves to no converter at all, and Option<Summary>, where the source wrote Option<&Summary>. Neither is a type a binding invented. Nothing in unfold, expand or registry/walk mentions a wire type, so the adapter-synthesized exemption has no members in this stage. So the stage gets a criterion stronger than a count: the variant reaches zero members and is deleted. The five PRs sum to exactly 45, and each says whether it migrates a site or deletes the code holding it -- the L2d move is labelled a move, the same way #248's deletions are labelled deletions.
…l it Counted the callers before starting L2a rather than after, and the split I wrote does not survive it. Every classifying helper in types_util has adapter callers -- option_inner_type 40, bare_path_ident 22, is_unit 18, first_type_arg 14, is_option_type 13 -- and none takes an &Flat, so it cannot consult the model from the inside either. L2 can stop api/core from calling them; only L3 and L4 can free them to be deleted. So L2a is 11 (not 13, the ident extractors cannot come along), L2b is 20 (not 26, the peel family stays), and L2c moves 0 rather than 2. L2d keeps its 4 because normalize_type and type_from_ident are the only two helpers in the file with no adapter caller at all -- which is what makes them movable while the other ten wait. api/core therefore ends the stage at 10, and the table naming them says so. That is what the rule about each entry's fate asks for: the ones that stay are named, and their reason is a dependency rather than a verdict.
Owner
Author
|
Closing unmerged: the stage plan belongs in the umbrella PR description and in #211, not in a file in the repo. The measurement and the L2a–L2e split it produced are carried over to #229's body and to #211's text, so nothing in it is lost. The two corrections it also carried — the ledger standing at 167 rather than 202, and the caller counts that make L2 end at 10 sites rather than 0 — go with them. |
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.
Docs only. Rewrites the L2 section of
docs/language-integration.md, which #229's body mirrors.The section was a by-file checklist written before the stage was investigated, and it inherited the map's default assumption — that some sites stay because they inspect types the adapter synthesized.
The measurement
Instrumented
Registry::ensure_entry(the one place a type-table cell is born) acrossexample-cbindgen,covertest-kotlin,perftest-candperftest-kotlin.TypeSubject::Adapterhas two members:MaybeUninit<Payload>&mut MaybeUninit<Payload>; the scan peels the&mutsyntactically. The model absorbedMaybeUninitintoRefMode::Out, so it has no node for the peeled spelling — and the cell resolves to no converterOption<Summary>Option<&Summary>; the peel family strips the&inside theOptionand re-composes a spelling nothing wroteNeither is a type a binding invented. Both are manufactured by the syntactic peeling L2 deletes, and both underlying types are ordinary source types.
Corroborating that the category has no genuine members:
unfold.rs,expand.rsandregistry/walk.rscontain zero mentions ofTypeEntryor a wire type, so the "legitimately the adapter's business" exemption has no members in this stage — all 45 sites classify source types. The.cross()path, which the code comments describe as the adapter-authored one, is exercised by covertest-kotlin and produced no cells either.Measured in-tree only, stated as such in the doc — the same shape of claim #248 makes about
fallible_partslogging zero.zenoh-flat's consumers are out of tree and do not currently build.What the section now says
An exit criterion ahead of the checklist, because it is stronger than a count and is what each PR reports against:
TypeCell's subject collapses to theTypeRef;location()becomesorigin.locationgated by the existinghas_position(), andkind()— already#[cfg(test)]— goes with it. Two production readers, both inresolve.rs.Then five PRs summing to exactly 45:
TypeSubject::AdapterEach says whether it migrates a site or deletes the code holding it — L2a drops three dead arms (
lower_typerefuses tuples and raw pointers;Group/Parenare transparent;named()drops generic args by design), and L2d is labelled a move, not a migration, the same distinction #248's deletions get.L2b and L2c also close two of the ledger header's listed blind spots by removing the code: the
seg.ident == "Option"family, andenum_shape/first_payload_variant, which take asyn::ItemEnumthatWATCHEDcannot see.Not changed
No counts move — this records the plan, not progress. The
#248 is deletion, not migrationnote stays, and the olderTypeKey-from-a-TypeRefbullet is folded into L2b rather than dropped.