fix(layout): Validate layout config and derive bypass lane search from routing parameters#36
Merged
Merged
Conversation
Bypass lane generation now derives its offsets and candidate count from shared lane step and expansion settings instead of a fixed array. A regression test locks the symmetric per-lane expansion and stable ordering so later tuning stays aligned with the routing search logic.
LayoutConfig now exposes explicit validation for finite, positive, and compaction-bound invariants instead of silently rewriting invalid values. Layout construction fails fast with a dedicated config validation error, and tests cover both direct validation and public build-path rejection.
Code Metrics Report
Details | | main (035c09c) | #36 (c00033b) | +/- |
|---------------------|----------------|---------------|-------|
+ | Coverage | 93.6% | 93.7% | +0.0% |
| Files | 71 | 71 | 0 |
| Lines | 28475 | 28584 | +109 |
+ | Covered | 26671 | 26789 | +118 |
+ | Test Execution Time | 1m35s | 1m31s | -4s |Code coverage of files in pull request scope (94.8% → 95.1%)
Reported by octocov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
values, non-positive dimensions, and inconsistent compaction bounds
Changes
BYPASS_CHANNEL_OFFSETSslice withBYPASS_CHANNEL_LANE_STEPandBYPASS_CHANNEL_EXTRA_LANESconstants that compute offsets from routing parameters at runtimebypass_channel_lane_count()andbypass_channel_offsets()helpers to generate laneoffsets procedurally
LayoutConfig::validated()(silent fallback to defaults) withLayoutConfig::validate()thatreturns
Result<(), LayoutConfigValidationError>compaction sub-config
build_layout_from_graph_with_config()so invalid configs fail early withdescriptive error messages