Skip to content

Load serialized region assignments as initial routing state - #133

Merged
seveibar merged 4 commits into
mainfrom
agent/immutable-fixed-occupancy
Jul 27, 2026
Merged

Load serialized region assignments as initial routing state#133
seveibar merged 4 commits into
mainfrom
agent/immutable-fixed-occupancy

Conversation

@seveibar

@seveibar seveibar commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • load existing regions[].assignments from SerializedHyperGraph into tiny-hypergraph's numeric routing state
  • seed route-owned port assignments, region segments, intersection caches, and congestion cost without adding regions or ports
  • keep preloaded routes out of the initial pending queue while allowing normal rip-and-reroute behavior when congestion requires it
  • serialize solved route segments back into standard region assignments
  • render preloaded assignments on their actual layer at iteration zero

Why

SerializedGraphRegion.assignments already describes which connection occupies the chord between two existing region ports. A separate graph-level fixed-occupancy schema duplicated that model and incorrectly made preloaded traces permanently immutable.

This implementation uses assignments as ordinary solver state. Intersections between preloaded and newly routed traces are therefore included in the same region intersection cache and cost calculation.

No change to @tscircuit/hypergraph's serialized schema is required.

Validation

  • bun run format:check
  • bun run typecheck
  • 96 non-image tests pass, including assignment loading, reripping, crossing detection, output round-tripping, bus-routing compatibility, and iteration-zero layer rendering
  • bun run build

Three local image-snapshot test files cannot load the checkout's missing macOS sharp native binary; GitHub Actions runs the complete suite.

@vercel

vercel Bot commented Jul 27, 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 Jul 27, 2026 6:23pm

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.

@seveibar seveibar changed the title Add immutable fixed trace occupancy Load immutable occupancy from serialized hypergraphs Jul 27, 2026
@seveibar seveibar changed the title Load immutable occupancy from serialized hypergraphs Load serialized region assignments as initial routing state Jul 27, 2026
@seveibar
seveibar requested a review from 0hmX July 27, 2026 18:27
@seveibar
seveibar marked this pull request as ready for review July 27, 2026 18:28
@seveibar

Copy link
Copy Markdown
Contributor Author

@0hmX imo this is good to go and sort of sets up Pipeline9

@seveibar
seveibar merged commit 1fe2546 into main Jul 27, 2026
6 checks passed
@tscircuitbot

Copy link
Copy Markdown

Thank you for your contribution! 🎉

PR Rating: ⭐⭐⭐
Impact: Major

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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