Skip to content

Avoid repeated sibling scans when repairing unclosed tags - #323

Merged
taoqf merged 1 commit into
taoqf:mainfrom
raymondstudio:codex/fix-unclosed-tag-repair
Oct 19, 2026
Merged

taoqf merged 1 commit into
taoqf:mainfrom
raymondstudio:codex/fix-unclosed-tag-repair

Conversation

@raymondstudio

Copy link
Copy Markdown

Repairing an unclosed element with many children moves each child through appendChild, which repeatedly filters the remaining source siblings. Cleanup becomes quadratic. Detach the child list once, then reuse the existing append operation. The same-tag and different-tag repair destinations, child order, parent pointers and parseNoneClosedTags behavior stay intact.

This is a synthetic current-9.0.4 reduction related to #260 and #280. It does not establish that the original live-site inputs in those reports are fixed.

Validation on Windows with Node 24.19.0 and Bun 1.3.14:

  • Build and declaration generation passed.
  • Eleven new regression/control tests: baseline 9 passed and 2 exceeded the bounded 8-second process limit; patched 11 passed. Both 32,000-child cases completed below 0.6 seconds locally after the change. These timings describe this machine and workload.
  • Complete compiled distribution suite: 285 passing, with the same 13 pre-existing pending tests (baseline 274 passing).
  • Independent Codex-agent review and 6,000 generated comparisons against the original repair behavior passed, including serialization, node data/ranges, order and parent/sibling links.
  • Standard package benchmark completed. The current/locked-last-release comparison was approximately 4.70/5.44 ms per file; that comparison is separate from the synthetic before/after reproduction.

Validation limits: the exact CI=true bun run test:ci command fails during Bun's Windows copy of the local @test/root dependency, before starting tests. The underlying complete compiled test tree was run directly. Source tests (ts-node initialization, fileExists undefined) and lint (TypeScript ESLint initialization, version.split undefined) encounter existing locked-toolchain failures. These checks are not reported as passed; hosted Linux CI and the full Node matrix remain pending. No dependencies, lockfiles, tests or checks were removed or disabled.

Prepared and independently reviewed with OpenAI Codex agents. Human maintainer review is pending; this is a draft, with no merge or release requested.

@raymondstudio
raymondstudio marked this pull request as ready for review October 17, 2026 09:07
Copilot AI balanced review requested due to automatic review settings October 17, 2026 09:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@taoqf
taoqf merged commit faea2c0 into taoqf:main Oct 19, 2026
3 checks passed
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.

3 participants