Skip to content

fix(layout): Validate layout config and derive bypass lane search from routing parameters#36

Merged
mhiro2 merged 2 commits into
mainfrom
fix/layout-routing-config-invariants
Apr 6, 2026
Merged

fix(layout): Validate layout config and derive bypass lane search from routing parameters#36
mhiro2 merged 2 commits into
mainfrom
fix/layout-routing-config-invariants

Conversation

@mhiro2

@mhiro2 mhiro2 commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace silent default-fallback config validation with strict error reporting that rejects NaN/infinite
    values, non-positive dimensions, and inconsistent compaction bounds
  • Derive bypass channel lane offsets from routing parameters instead of a hardcoded offset table

Changes

  • 82516f3 : refactor(layout): derive bypass lane search from routing parameters
    • Replace the hardcoded BYPASS_CHANNEL_OFFSETS slice with BYPASS_CHANNEL_LANE_STEP and
      BYPASS_CHANNEL_EXTRA_LANES constants that compute offsets from routing parameters at runtime
    • Introduce bypass_channel_lane_count() and bypass_channel_offsets() helpers to generate lane
      offsets procedurally
    • Add a test verifying symmetric expansion of bypass candidates per lane
  • f7002ea : fix(layout): reject invalid layout config combinations
    • Replace LayoutConfig::validated() (silent fallback to defaults) with LayoutConfig::validate() that
      returns Result<(), LayoutConfigValidationError>
    • Validate finiteness, positivity, and upper-bound consistency for all numeric fields including
      compaction sub-config
    • Integrate validation into build_layout_from_graph_with_config() so invalid configs fail early with
      descriptive error messages

mhiro2 added 2 commits April 6, 2026 23:10
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.
@mhiro2 mhiro2 self-assigned this Apr 6, 2026
@mhiro2 mhiro2 added the enhancement New feature or request label Apr 6, 2026
@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown

Code Metrics Report

main (035c09c) #36 (c00033b) +/-
Coverage 93.6% 93.7% +0.0%
Test Execution Time 1m35s 1m31s -4s
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%)

Files Coverage +/- Status
crates/relune-layout/src/layout.rs 95.1% +0.3% modified

Reported by octocov

@mhiro2
mhiro2 merged commit cebe8c4 into main Apr 6, 2026
3 checks passed
@mhiro2
mhiro2 deleted the fix/layout-routing-config-invariants branch April 6, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant