Skip to content

Tune crossing-via estimation, clamp probability, and add tests#645

Closed
0hmX wants to merge 5 commits intomainfrom
codex/improve-unravelsolver-test-for-mse
Closed

Tune crossing-via estimation, clamp probability, and add tests#645
0hmX wants to merge 5 commits intomainfrom
codex/improve-unravelsolver-test-for-mse

Conversation

@0hmX
Copy link
Copy Markdown
Contributor

@0hmX 0hmX commented Mar 11, 2026

Motivation

  • Improve the heuristic that estimates via usage and make the resulting failure probability better behaved and bounded between 0 and 1.
  • Add unit tests to lock in expected behavior for target nodes, single-layer nodes, coefficient usage, and clamping for large inputs.

Description

  • Adjusted the coefficients used to estimate vias in calculateNodeProbabilityOfFailure to 0.65, 0.3, and 0.32 for numSameLayerCrossings, numEntryExitLayerChanges, and numTransitionCrossings respectively.
  • Changed the used-capacity formula to const estUsedCapacity = (estNumVias / 1.8) ** 1.15 to reflect the retuned scaling and exponent.
  • Add explicit bounding of the returned probability with Math.max(0, Math.min(1, approxProb)) so results are always in [0,1].
  • Added unit tests in tests/solvers/calculateCrossingProbabilityOfFailure.test.ts that validate target behavior, single-layer behavior, coefficient math, and clamping of very large values.

Testing

  • Ran the new test suite with bun:test including calculateCrossingProbabilityOfFailure.test.ts, and all tests passed.
  • Tests cover calculateNodeProbabilityOfFailure returning 0 for target nodes, 1 for single-layer nodes with crossings, correct coefficient usage and formula, and clamping large estimates to 1.

Codex Task

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants