Skip to content

[codex] Remove empty section optimize skip#117

Open
0hmX wants to merge 1 commit into
mainfrom
codex/remove-empty-section-skip
Open

[codex] Remove empty section optimize skip#117
0hmX wants to merge 1 commit into
mainfrom
codex/remove-empty-section-skip

Conversation

@0hmX

@0hmX 0hmX commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What changed

This removes the empty-section fast path added in 7891dd9 from TinyHyperGraphSectionPipelineSolver.

Specifically, it removes:

  • the _step() override that short-circuits optimizeSection
  • trySkipEmptyOptimizeSection()

The rest of the 7891dd9 memory optimization set is left intact.

Why

7891dd9 introduced a real port-point-pathing memory improvement, but it also changed downstream routing output in tscircuit-autorouter and caused SVG snapshot regressions.

The highest-signal behavior change was the new empty-section skip. In pipeline4 consumers, an empty section mask is exercised, and skipping optimizeSection entirely changes the final route geometry.

This PR keeps the memory optimization work while removing the output-changing fast path.

Impact

  • restores downstream snapshot stability for pipeline4 consumers
  • preserves nearly all of the measured port-point-pathing memory win from 7891dd9

Validation

Downstream SVG / snapshot checks in tscircuit-autorouter passed with this skip-only variant:

  • bun test tests/e2e3.test.ts
  • bun test tests/e2e3-multisection.test.ts
  • bun test tests/features/pipeline4-dataset01-circuit011-visual.test.ts
  • bun test tests/features/pipeline4-dataset01-circuit015-visual.test.ts

Port-point-pathing memory comparison on srj18 sample001 using /usr/bin/time peak RSS:

  • origin/main

    • avg: 964,858 KB = 942.2 MB = 0.92 GB
    • median: 948,384 KB = 926.2 MB = 0.90 GB
  • full 7891dd9

    • avg: 627,702 KB = 612.99 MB = 0.60 GB
    • median: 630,068 KB = 615.30 MB = 0.60 GB
  • skip-only variant

    • avg: 633,183 KB = 618.34 MB = 0.60 GB
    • median: 634,268 KB = 619.40 MB = 0.60 GB

So this variant remains about 34% below the origin/main baseline while staying within about 5.5 MB average RSS of full 7891dd9.

@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:35am

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