Skip to content

[codex] Revert memory optimizations that change routing output#116

Draft
0hmX wants to merge 1 commit into
mainfrom
codex/revert-memory-svg-regression
Draft

[codex] Revert memory optimizations that change routing output#116
0hmX wants to merge 1 commit into
mainfrom
codex/revert-memory-svg-regression

Conversation

@0hmX

@0hmX 0hmX commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What changed

This reverts the 7891dd9 memory-optimization changes that altered routing output in downstream snapshot tests.

Reverted areas:

  • duplicate-port solver memory reductions
  • compat metadata copy changes
  • compact hop-cost storage in core.ts
  • section-pipeline replay/state-release/caching changes
  • the empty-section optimize-stage skip
  • the added compat regression test tied to the new metadata behavior

Why

The changes were introduced as memory optimizations, but they were not output-neutral.

A downstream consumer (tscircuit-autorouter) started failing SVG snapshot tests after updating to 7891dd9. The clearest repro was tests/e2e3.test.ts, which passed on 1487056, failed on 7891dd9, and passed again after reverting this change set.

The highest-signal behavior change was the new empty-section fast path in TinyHyperGraphSectionPipelineSolver, which skips optimizeSection entirely when the section mask is empty. In pipeline4 consumers that path is exercised and changes final routing geometry.

Impact

This restores pre-7891dd9 routing behavior for consumers that depend on stable tiny-hypergraph output.

Validation

Validated from the linked tscircuit-autorouter checkout using the local path dependency:

  • bun test tests/e2e3.test.ts
  • bun test tests/e2e3.test.ts tests/e2e3-multisection.test.ts
  • SVG/snapshot-oriented sweep:
    • rg -l "toMatchGraphicsSvg|toMatchSvgSnapshot" tests | sort > temp/svg-test-files.txt
    • xargs bun test < temp/svg-test-files.txt

Observed result in the sweep:

  • no SVG snapshot mismatch failures after the revert
  • remaining failures were existing timeouts, not snapshot diffs

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tiny-hypergraph Ready Ready Preview, Comment Jun 12, 2026 6:01am

Request Review

@tscircuitbot

Copy link
Copy Markdown

Benchmark This PR

Run benchmarks by commenting on this PR:

/benchmark [benchmark.sh args...]
/benchmark --dataset <hg07|srj18> --limit <n> --solver <core|poly> --families <default|default+deep|all> --concurrency <n|auto>

Everything after /benchmark is forwarded directly to ./benchmark.sh.
The result comment shows the matching dataset from the latest stored main-branch benchmark artifact beside the PR run; main is not rerun for each PR benchmark request.

Examples:

  • /benchmark -> hg07, all samples, core solver
  • /benchmark --dataset srj18 --limit 20 -> first 20 srj18 samples
  • /benchmark --dataset srj18 --concurrency auto -> srj18 samples with runner CPU-count concurrency
  • /benchmark --sample sample002 -> one hg07 sample
  • /benchmark --limit 20 --solver poly -> first 20 hg07 samples with the poly solver
  • /benchmark --limit 40 --families default+deep -> first 40 hg07 samples with deeper candidate families

Any PR whose title contains [BENCHMARK TEST] will automatically run the benchmark workflow on PR updates.

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.

2 participants