Skip to content

refactor(layout): delete the IFC packer's unreachable non-persist commit arm - #511

Open
send wants to merge 3 commits into
mainfrom
layout-inline-dead-arm
Open

refactor(layout): delete the IFC packer's unreachable non-persist commit arm#511
send wants to merge 3 commits into
mainfrom
layout-inline-dead-arm

Conversation

@send

@send send commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Dead-arm prereq PR of the #11-line-box-decorated-inline-content umbrella (sibling of the seam-3 prereq #508, which landed as 7e256029 — this PR's base). Plan memo: docs/plans/2026-08-inline-nonpersist-dead-arm.md (ships with this PR).

What

LinePacker::flush_line's rendered-content branch forked on self.flow_align: the Some arm runs the per-line natural→painted bake, the else arm committed current_line_entity_rects unaligned, per break segment, unmerged. The else arm was provably unreachable:

  1. FragmentationType is a two-variant exhaustive enum — Page | Column (lib.rs:36-42).
  2. InlineFragConstraint.fragmentation_type is non-optional (inline/mod.rs:95).
  3. Therefore persist_candidate = frag_constraint.is_none() || frag_is_paged || frag_is_column was identically true, so flow_align was always Some (sole LinePacker::new caller), so the else arm and place_item's is_some() recording gate never took their other branch.

Deleted the arm, dropped persist_candidate, and narrowed Option<FlowAlign>FlowAlign so the dead fork cannot grow back type-silently.

The pre-push gate then surfaced the same class one level down and it is closed here too: with the pre-gate gone, do_carrier is definitionally !persist_flow, so reconcile_flows's two-bool interface re-encoded the deleted third state (its persist_flow || do_carrier guard was a tautology). The disposition is now one bitreconcile_flows takes persist_flow alone, the else arms are the mid-break carrier case, and the arms' exclusivity holds by construction. A false comment claim the consolidation had replicated (non-persisted lines "discarded" — they are in fact carried per column via ColumnFlowSlice; only a probe's are discarded) is corrected at every site.

persist_flow keeps its live multicol whole-in-column narrowing; the carrier route, the paged slice/rebase, and the suppressed-line discard arm are all reachable and untouched.

Behaviour

None — every deleted branch was unreachable, every de-gated site had an identically-true guard, and the fix-delta re-check proved the dedented blocks token-identical with exact arm truth tables. Workspace suite 12785/12785, elidex-layout-block 325/325, clippy clean, doc + trip-wires pass. (cargo deny fails on every change due to the upstream advisory-db breakage RUSTSEC-2026-0244 — unrelated.)

Ledger (performed at landing, per the umbrella's §10 dead-arm rows)

  1. Close #11-inline-align-clientrects-nonpersist-path — the arm it books work against is deleted.
  2. Split the joint "fold into terminal-Z C-3/C-4" parenthetical in the slot SoT so it survives for #11-inline-relayout-box-staleness alone.

⚠ The reconcile_flows interface collapse exceeds the surface the umbrella's §5.2 dead-arm row enumerates; the memo discloses it and records it as an input for the umbrella's round 20.

🤖 Generated with Claude Code

send and others added 3 commits August 27, 2026 18:22
…mit arm

FragmentationType is a two-variant exhaustive enum (Page | Column) and
InlineFragConstraint.fragmentation_type is non-optional, so
persist_candidate = frag_constraint.is_none() || frag_is_paged || frag_is_column
was identically true: flow_align was always Some, flush_line's else arm
(the unmerged per-segment entity-rect commit) was unreachable, and
place_item's is_some() recording gate never failed. Delete the arm, drop
persist_candidate, and narrow Option<FlowAlign> to FlowAlign so the dead
fork cannot grow back type-silently. persist_flow keeps its live multicol
whole-in-column narrowing. No behaviour change: workspace suite green
(12785 tests), elidex-layout-block 325/325.

Dead-arm prereq PR of the #11-line-box-decorated-inline-content umbrella
(seam-3 sibling; plan memo: docs/plans/2026-08-inline-nonpersist-dead-arm.md).
At landing it closes #11-inline-align-clientrects-nonpersist-path (the arm
the slot booked work against no longer exists).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…eletion

Three hygiene fixes from the 4-angle cleanup pass: reword reconcile.rs's
mutual-exclusivity proof (do_carrier is now the exact negation of
persist_flow, not a falsifier of its deleted second conjunct); drop the
duplicate block_size binding the dedent stranded beside line_height in
flush_line; consolidate the persistence-gate narration at the persist_flow
gate (the FlowAlign construction site keeps only the recording paragraph).
Comment/binding-only; elidex-layout-block 325/325, multicol suite green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…fix the discard-claim narration

Pre-push /code-review findings, applied. With the dead pre-gate gone,
do_carrier was definitionally !persist_flow, so reconcile_flows's two-bool
interface re-encoded the deleted third state: its persist_flow || do_carrier
guard was a tautology whose skip path was unreachable by the same sole-caller
argument that deleted the packer arm. reconcile_flows now takes persist_flow
alone (the else arms ARE the carrier case), the guard is dropped, the
redundant do_carrier conjuncts go with it, and inline/mod.rs derives
do_carrier = !persist_flow — the arms' exclusivity holds by construction.

Also corrects a false claim the comment consolidation had replicated to four
sites: a non-persisting run's recorded lines are not "discarded" — they are
carried per column via ColumnFlowSlice (terminal-Z C-1/C-2); only a probe's
are discarded. Plus: stranded "When persisting:" framing dropped, FlowAlign
heading reworded, frag_is_* bindings moved beside their consumers.

Behavior-preserving (focused re-check: dedented block token-identical, arm
truth tables exact); workspace suite 12785/12785, clippy clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@send

send commented Aug 27, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 9decbc2a84

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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