Skip to content

Preserve Unicode source offsets through selectable reflow - #159

Draft
isomorphisms wants to merge 8 commits into
feature/reflow-two-waysfrom
feature/reflow-source-breaks
Draft

isomorphisms wants to merge 8 commits into
feature/reflow-two-waysfrom
feature/reflow-source-breaks

Conversation

@isomorphisms

@isomorphisms isomorphisms commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Scope

Follow-on to IB PR #157, Implement selectable reflow algorithms, streaming and incremental reuse. Adds a source-bound line-breaking representation, rather than routing canonical text through the previous lossy space-joined segment output.

  • IB.Reflow.SourceBreaks represents verified code-point offsets (not UTF-8 byte offsets), mandatory/optional/soft-hyphen/zero-width/EOF cuts and source-bound line spans. Original decoded source is recovered exactly from contiguous spans.
  • IB.Reflow.Source provides reflow_source and reflow_at_breaks: selects greedy, squared/cubic/minimax, final-line-free and exact minimum-line-count optimizers. A displayed soft-hyphen cut gets a visible hyphen; the source retains U+00AD. Hard line separators/ZWSP are suppressed only in derived display text.
  • Fail closed: a source-offset request for streaming or typographic box/glue is not silently substituted by a batch approximation. Existing streaming/Knuth-Plass implementations remain in PR Implement selectable reflow algorithms, streaming and incremental reuse #157 for their supported representation.
  • Bounded subset of Unicode 18.0/UAX Prefetch scientific figures on committed navigation #14 (ASCII space, mandatory CR/LF/CRLF/NEL/Unicode separators, SHY, ZWSP and selected Han-to-Han boundaries); not claimed to implement all Unicode 18 segmentation or grapheme shaping. External full segmentation may supply validated cut offsets.
  • SourceReflowSmoke.idric checks Unicode/RTL examples, combining/emoji joiner/CRLF refusal, soft-hyphen display, source reconstruction, mandatory blank lines, NBSP and zero-width spaces, overwide preservation, and unsupported mode errors.
  • Existing exact-head Idriç CI compiles and gates source reflow smoke.

Acceptance boundary

Host compilation and behavior passed at 4a7380c in foundation run 39344768139, with exact-text oracle and universal gate also passing. CI-REPAIR-01 adds an explicit candidate type, bounded total greedy descent with exhaustion refusal, and pinned-parser-compatible smoke applications without removing any assertion. Native pixel shaping, grapheme segmentation, A1/C67 physical execution and full UAX #14 conformance are NOT_RUN. Draft and unmerged; no release/merge claim.

Annotate the candidate selection, bound greedy recursion by the candidate count and refuse exhausted descent, and keep multiline smoke applications within the pinned parser's accepted syntax. The original Unicode/source-offset, all-mode, unsupported-mode and full reflow assertions remain intact.
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