ReviewOS

home-lang/home

fix(markdown): bound ANSI indentation for pathological nesting

#739
Closed glennmichael123 opened this 9 days ago ·
9 days ago

Bun parity gap confirmed from the js/bun Markdown edge-case corpus.

Home recomputes and emits the full block stack indentation for every rendered line. At thousands of nested quotes/lists this makes output quadratic and fails the linear-output assertions. Bun live Rust tracks quote depth and aggregate list indentation incrementally, then caps visible indentation at 128 columns; Home still carries the older uncapped Zig shape.

Scope:

  • port the quote_depth and list_indent_cols accounting from Bun live ansi_renderer.rs
  • centralize push/pop accounting
  • make writeIndent, currentIndent, and quote-bar emission use the same capped counts
  • verify the two pathological nesting cases plus representative ordinary list/quote output

Parent: #66

9 days ago

Ported Bun's O(1) ANSI indentation accounting and 128-column output cap in 60493af. Verified against Bun's live Rust implementation; Zig AST, formatter, and whitespace checks pass. Fresh native acceptance remains pending because the serialized debug build exceeded the fixed 3,840 MB safety ceiling and was killed rather than allowing host pressure.

Sign in to comment on this issue.