Tasks/Chips & Compute Systems/Chip Design Automation

Optimize multibit flip-flop banking and placement

Bank and place multi-bit flip-flops at minimum weighted cost

mbff_banking_placement Chips & Compute Systems Chip Design Automation
instruction.mdthis is what the agent is given

You inherit a deliberately weak template for an industrial-style EDA placement problem: multibit flip-flop (MBFF) banking and placement. Given a placement testcase, your method must emit a flip-flop placement + pin-mapping that minimizes a weighted cost (power, area, timing, displacement) while keeping the design legal and functionally equivalent. The shipped template only parses a case and writes a valid-but-unoptimized output — going weak→strong is the task. Your submission is re-run on sealed hidden testcases for scoring; mean_final_score is lower-is-better.

Hard Constraints

  • Submit an algorithm (solve), not precomputed answers — the grader re-runs your code on hidden cases. Do not key on visible or hidden filenames.
  • Keep the exact signature: solve(input_path: str, output_path: str) -> None. It reads one testcase from input_path and must write a valid output file to output_path.
  • You may move, bank, or debank flip-flops; you must not move or modify combinational gates.
  • Every output flip-flop instance must be inside the die, on a legal placement-row site, and non-overlapping.
  • D, Q, and CLK connectivity must stay functionally equivalent. Banking is only legal when all clock pins in the banked group connect to the same clock net.
  • The output must list only resultant flip-flop instances and original→result pin mappings.

What You Have

  • Visible testcases: /app/data/ (sampleCase, testcase1_0812.txt, testcase2_0812.txt). Hidden cases stay sealed in the grader and are scored under a different cost-weight regime — the Alpha/Beta/Gamma/Lambda weights and DisplacementDelay differ from the visible ones, so the power/area/timing/displacement trade-off is not the same one.
  • The editable baseline /app/methods/main/this directory is what gets graded. It is a minimal template: it parses a case and writes a valid unoptimized output (with a small legalization snap), so the solve(...) contract and output format are handled for you. It carries no real optimization. Improve it in place or replace the algorithm entirely.
  • Your self-check surface (free, unlimited): python /app/selfcheck.py runs your current methods/main/solver.py on the visible cases through the same legality + scoring gate the grader uses (sanityplacement_checkerpreliminary-evaluator, bundled in /app/tools/). It reports per case whether the placement is LEGAL and its score. An illegal placement scores nothing — validate here before relying on a change. The checker pipeline is slow on the large cases (full run ~3.4 min), so iterate against a single case (python /app/selfcheck.py sampleCase is seconds; python /app/selfcheck.py testcase1_0812.txt is ~80 s) and run the full set only before committing to a change.

What You Submit

Edit /app/methods/main/solver.py to expose this exact signature:

def solve(input_path: str, output_path: str) -> None:
    ...

You may add helper Python or C++ files next to solver.py (the runtime provides g++/make/Boost/OpenMP and python3/numpy). The output file format is:

CellInst <InstCount>
Inst <instName> <libCellName> <locationX> <locationY>
<originalCellPinFullName> map <resultCellPinFullName>
...

There is no submit step and no per-attempt feedback — work and self-check for as long as your run window allows, then leave your best solver.py in place. It is graded once at the end on the hidden testcases.

How It Is Judged

After your run, the grader copies your methods/main/ into a clean Linux x86_64 sandbox, runs your solve(...) on each hidden case, then runs the official checker/evaluator pipeline on each output:

  1. sanity
  2. placement_checker
  3. preliminary-evaluator

The raw metric is mean_final_score across the hidden cases, lower is better. A submission that is illegal on any hidden case earns no credit (it cannot bank a good mean from only its legal cases).

Metric

mean final score over the three sealed hidden cases · lower is better

A*TNS + B*FF power + G*FF area + L*over-utilised bins, from the contest's own C++ evaluator

anchorvisible setheld-outreward
Bshipped weak template309,206,249.4287,162,537.500.00
Sexpert C++ reference solver247,900,000.0033,824,200.810.60
Uproved relaxation bound241,586,248.6829,919,173.801.00
normalisation
m <= 0 or m >= B0
B > m >= S0.6 * (B - m) / (B - S)
m < S0.6 + 0.4 * (S - m) / (S - U)

m = this run's held-out metric  ·  B = shipped weak template  ·  S = expert C++ reference solver  ·  U = proved relaxation bound

Linear in the cost; the band spans only 2.9x. The three case scores are averaged first, then mapped once. Illegal on any case -> 0.

Rollouts

101 minwall clock
-spend
-tokens
8versions, 8 kept
0.87M 0.90M 0.93M 0.96M 0.99M 0 30 60 90 120 agent step (this harness reports no tokens or timestamps) testcase2 self-check score, lower is better expert C++ reference solver · visible: 247,900,000.00 · off this scale v0 v1 v3 v5 v6 v7 v8 v9
keptrevertedno scoreturning point
  1. v0Inherited baseline: identity flip-flop placement with site snap, no bankingsampleCase only
  2. v1Cost-aware 4/2-bit banking plus site legalizer, grid packing by benefit ratioBank only where benefit per unit displacement, priced by the weights read from the input file, pays for the move.testcase1 only
  3. v3Hierarchical NN clustering; Manhattan-capped legalizer splits banks with no near siteCap how far a bank may be walked to reach a legal site, and split it rather than let the legalizer cross the die.1,001,510
  4. v5Benefit-scaled legalizer search budget; same-row TNS refine; 2+2 merge into 4-bitGive each bank a search budget proportional to its own banking benefit, then refine timing within the row.866,794
  5. v6Leftover 1-bit flip-flops pair up at twice the cluster radius866,657
  6. v7Cluster radius 8x median nearest-neighbour spacing863,194
  7. v8Cluster radius 12x median nearest-neighbour spacing863,194
  8. v9Extra-pin mapping for hidden scan and reset pins; dead refine pass removed863,194

Eight snapshots in 101 min; the harness reports no token or cost data. Two reverted variants were never snapshotted; testcase2 stops at v7.

On the hidden set

held-out metricreward
shipped weak template87,162,537.500.00
expert C++ reference solver33,824,200.810.60
proved relaxation bound29,919,173.801.00
this run35,910,699.510.5765
220 minwall clock
$33.41spend
50.3Mtokens
8versions, 7 kept
0.80M 0.85M 0.90M 0.95M 1.00M $0 $7.5 $15 $22 $30 cumulative spend on the run testcase2 self-check score, lower is better expert C++ reference solver · visible: 247,900,000.00 · off this scale v0 v1 v2 v3 v4 v5 v6 v7
keptrevertedno scoreturning point
  1. v0Shipped template: parse, snap-legalise, re-emitsampleCase only6 min · $1.61
  2. v1Full pipeline: STA criticality budgets, greedy banking, band legalizerReverse-engineer the evaluator's cost from the binary, then gate every merge on it.988,00028 min · $6.32
  3. v2Adaptive-grid k-NN neighbours per clock net, 3 merge passes, exact displacement cap952,30034 min · $7.72
  4. v3Exact internal re-score gates every refinement pass; timing re-anchored each passRe-implement the evaluator to within 0.01%, then accept a pass only if it improves, so the approximate model cannot hurt.772,40055 min · $11.11
  5. v4Candidate ladder: identity, in-place downsize, banking at tscale 1/4/16/64, keep bestA perturbed-weight sweep showed v3 1.47x worse than doing nothing; keeping identity in the set makes that impossible.regime ratios only84 min · $16.03
  6. v5Identity fallback snaps off-site input coordinates to the nearest row site773,000126 min · $23.30
  7. v6Damped refinement: retry only the worst-cost quarter of the clusters773,000197 min · $29.92
  8. v7Robustness: tolerant pin naming, extra-pin bail-out, occupancy-grid guard773,000219 min · $33.04

Eight snapshots, 220 min, $33.41: one visible self-check is minutes of C++ checker. v2/v3 use the agent's own 0.01%-exact re-score.

On the hidden set

held-out metricreward
shipped weak template87,162,537.500.00
expert C++ reference solver33,824,200.810.60
proved relaxation bound29,919,173.801.00
this run39,763,077.890.5332

Re-graded after a verifier fix; this is the corrected reward.

75 minwall clock
$14.98spend
23.7Mtokens
18versions, 8 kept
0.90M 1.05M 1.20M 1.35M 1.50M 1.65M $0 $3 $6 $9 $12 cumulative spend on the run testcase2 self-check score, lower is better expert C++ reference solver · visible: 247,900,000.00 · off this scale v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17
keptrevertedno scoreturning point
  1. v0Untouched shipped template1,675,1700 min · $0.21
  2. v1Cost-aware same-clock 4/2-bit banking with pin-assignment geometryMerge nearby same-clock flip-flops into 4- and 2-bit cells, but only where the file's own weights say it pays.1,209,89016 min · $2.28
  3. v2Retry rejected banks after accepted ones have consolidated whitespace1,188,90020 min · $2.89
  4. v3Aspect-ratio-aware clustering favouring vertically aligned groupstestcase1 only24 min · $3.47
  5. v4Order equally sized banks by objective gain when placing1,148,26026 min · $3.82
  6. v5Repartition rejected 4-bit groups into cost-aware 2-bit banksA 4-bit group failing its gate used to fall back to nothing; splitting it into 2-bit banks recovers most of the win.966,33730 min · $4.46
  7. v6Alternative 1-bit cell sizing for residual singles, occupancy-checkedA lever beyond banking: give never-merged flip-flops a cheaper single-bit cell that still fits the occupancy grid.960,22434 min · $5.04
  8. v7Second same-clock 2-bit matching pass across residual group boundaries953,95138 min · $5.64
  9. v8Net-aware geometry from D-driver and Q-sink endpoints plus locality anchors958,10645 min · $7.30
  10. v9Locality-capped preference for grouping data-connected flip-flops950,68147 min · $7.75
  11. v10Legal-site normalization for off-grid or out-of-die original flip-flops953,95150 min · $8.53
  12. v11Recompute the bit-to-pin permutation at the final legalized bank coordinate955,25652 min · $8.99
  13. v12Full-weight Manhattan pin-motion penalty instead of the quarter-weight proxy958,32554 min · $9.45
  14. v13Per-bin utilization accounting with a Lambda-priced violation allowance953,95160 min · $11.05
  15. v14Drop the heuristic pin-motion penalty, keep the locality and Q-delay terms945,81062 min · $11.61
  16. v15Interpolated 0.1 pin-motion proxy coefficient964,66066 min · $12.51
  17. v16Zero-penalty acceptance decoupled from motion-penalized placement priority961,20070 min · $13.53
  18. v17Triple-weight negative-slack D pins in local bank geometry959,41271 min · $14.13

Eighteen snapshots in 71 min for $14.13. Nothing after v7, at 38 min, improved the visible mean; v10, the submitted one, is an off-grid safety net.

On the hidden set

held-out metricreward
shipped weak template87,162,537.500.00
expert C++ reference solver33,824,200.810.60
proved relaxation bound29,919,173.801.00
this run41,118,376.940.5179
236 minwall clock
$77.89spend
121.3Mtokens
55versions, 48 kept

No trajectory curve: this run left no comparable self-check measurement, so there is nothing to plot against spend. The versions and what each one changed are below.

  1. v0Untouched shipped template: one output FF per input, nearest-site snapno evaluator (LFS)4 min · $1.05
  2. v1Full pipeline: same-clock spatial banking, Pareto filter, Hungarian pin slotsReplace the one-FF-per-FF template with same-clock spatial banking gated on a power/area/timing proxy.own proxy cohorts only17 min · $2.55
  3. v2Incremental bin-overflow term, net-aware Q-delay propagation, bounded neighbour indexown proxy cohorts only26 min · $3.81
  4. v3Cross-capacity Pareto pruning so composed smaller banks can beat one large cellown proxy cohorts only28 min · $4.58
  5. v4Allow dominated power/area/Q tradeoffs when the case weights predict a strict gainown proxy cohorts only30 min · $5.02
  6. v5Safe weighted lower-bound proposal filter; distance-ordered search over all rowsown proxy cohorts only34 min · $6.70
  7. v6Conflict-aware group ranking: gain minus half the best alternative forgoneown proxy cohorts only39 min · $7.70
  8. v7Transactional debanking of existing multi-bit cells into weighted-optimal partsAdd the opposite move: split an existing multi-bit cell into smaller cells when the weights prefer them.own proxy cohorts only45 min · $8.59
  9. v8Incremental endpoint timing state, scoring Q-delay and D-motion through TNS clippingown proxy cohorts only49 min · $9.78
  10. v9Two-pass post-bank coordinate descent once source-FF obstacles disappearown proxy cohorts only54 min · $11.01
  11. v10Timing-aware Hungarian bit-to-slot mapping on exact marginal clipped TNSown proxy cohorts only58 min · $12.38
  12. v11Expand each seed to the top four capacity-filling neighbour subsetsown proxy cohorts only62 min · $14.56
  13. v12Rank proposals by exact clipped-TNS at the group's ideal origin, not spreadown proxy cohorts only65 min · $15.70
  14. v13Order capacities by best weighted static cost per bit instead of largest-firstown proxy cohorts only67 min · $16.54
  15. v14Add average downstream Q-delay TNS sensitivity to the capacity cost-per-bit orderown proxy cohorts only70 min · $17.54
  16. v15Make the Q-sensitive capacity order per clock domain; schedule tasks by own costown proxy cohorts only74 min · $18.82
  17. v16Collision-free deterministic naming against the full original instance namespacelegality checks only75 min · $19.31
  18. v17Final coordinate descent may switch between same-bit library implementationsown proxy cohorts only79 min · $20.78
  19. v18Raise the legal-site budget 96 -> 192 after a 48/96/192 sweepown proxy cohorts only82 min · $21.97
  20. v19Expose the refinement pass count; sweep 1/2/3/4 and keep twotuning sweep only84 min · $23.01
  21. v20Combinatorial logical-bit partitioning for debanking, not contiguous pin slicesown proxy cohorts only88 min · $24.86
  22. v21Prune debanking to 16 compositions, 6 partitions, 16 trials, 96 sites per partruntime only90 min · $26.71
  23. v22Pairwise same-clock bit exchange between nearby cells via combined-slot Hungarianown proxy cohorts only98 min · $29.01
  24. v23Expose bit-exchange window and passes; sweep and keep window 4, two passestuning sweep only100 min · $30.53
  25. v24Exact post-placement merge of nearby same-clock result cellsown proxy cohorts only107 min · $32.93
  26. v25Exact post-placement split into bounded smaller-cell compositionsown proxy cohorts only114 min · $35.35
  27. v26Exact pairwise exchange of occupied result-cell sites to break mutual blockingown proxy cohorts only121 min · $36.74
  28. v27Memoized transitive Q-to-D reachability through fixed combinational gate DAGsown proxy cohorts only128 min · $38.03
  29. v28Use transitive timed fanout in capacity ordering and split pruning tooown proxy cohorts only130 min · $38.73
  30. v29Add exact old-D/new-D pin-alignment site anchors to final coordinate descentown proxy cohorts only135 min · $39.68
  31. v30Project bit-exchange timing onto affected endpoints only; exchange 2.4x fasterruntime only140 min · $40.95
  32. v31Project late merge/split TNS onto changed cones; carry split overflow incrementallyruntime only143 min · $42.00
  33. v32Cache the per-group target-library Q-delay map across its site trialsruntime only146 min · $43.04
  34. v33Fresh legal-site budget sweep at 192/256/384; keep 192tuning sweep only149 min · $43.85
  35. v34Late-merge neighbour-window sweep at 4/8/12; keep 4tuning sweep only151 min · $44.60
  36. v35Bounded three-cell same-clock logical-bit reassignment with exact TNS acceptanceown proxy cohorts only158 min · $47.15
  37. v36Match the official checker's float geometry, including nextafter grid boundslegality checks only162 min · $48.01
  38. v37Structural and legality validation checkpoint, no behaviour changelegality checks only164 min · $48.90
  39. v38Overflow-only far-site scout: 768 sites ranked by density, best 12 exactly scoredAttack the density term directly: scan far legal sites by bin occupancy when the near ones all overflow.own proxy cohorts only170 min · $51.15
  40. v39Mixed-source-bank validation checkpoint, no behaviour changelegality checks only172 min · $51.86
  41. v40Widen the overflow scout to 1,200 legal sites and 20 exact finalistsown proxy cohorts only177 min · $53.89
  42. v41Extend overflow-only far-site scouting to exact late merge candidatesown proxy cohorts only180 min · $55.09
  43. v42Bounded four-cell logical-bit reassignment after the triple passown proxy cohorts only183 min · $56.28
  44. v43Scout density per candidate library even when the design has zero overflowown proxy cohorts only185 min · $57.16
  45. v44Extend far-density scouting to initial bank placement under an exact lower boundown proxy cohorts only188 min · $58.60
  46. v45Apply the same far-density scout to each part of transactional debankingown proxy cohorts only190 min · $59.81
  47. v46Add eight nearest density-improving sites beside the 20 far finalistsown proxy cohorts only197 min · $62.75
  48. v47Deep timing-reachability validation checkpoint, no behaviour changelegality checks only198 min · $63.15
  49. v48One extra cleanup placement pass only when a far-density finalist was chosenown proxy cohorts only203 min · $65.41
  50. v49Deterministic two-start portfolio, regret 0.5 and 0, exact objective picks outputown proxy cohorts only213 min · $69.80
  51. v50Third start at regret 1.5 for designs with at most 1,500 input flip-flopsown proxy cohorts only216 min · $71.65
  52. v51Portfolio breadth sweep adding regret 0.25 and 0.75; keep the three factorstuning sweep only219 min · $73.37
  53. v52Fourth start: largest-capacity-first at regret 0.5, small designs onlyown proxy cohorts only226 min · $76.49
  54. v53Fifth start using weighted-static-cost capacity orderingown proxy cohorts only232 min · $77.30
  55. v54Final robustness checkpoint, no behaviour changelegality checks only236 min · $77.81

Fifty-five snapshots in 236 min for $77.89, none officially scored: the visible cases and the evaluator shipped as LFS pointer files.

On the hidden set

held-out metricreward
shipped weak template87,162,537.500.00
expert C++ reference solver33,824,200.810.60
proved relaxation bound29,919,173.801.00
this run86,047,520.300.0125
74 minwall clock
$4.46spend
20.6Mtokens
2versions, 2 kept
1.675M 1.675M 1.675M 1.675M 1.675M $0 $1 $2 $3 $4 cumulative spend on the run testcase2 self-check score, lower is better expert C++ reference solver · visible: 247,900,000.00 · off this scale v0 v1
keptrevertedno scoreturning point
  1. v0Untouched shipped template1,675,17074 min · $4.32
  2. v1Morton-order same-clock clustering with an exact per-group cost-delta banking gateBank a group only if the exact delta of power, area, wirelength and slack is negative; otherwise leave it unbanked.1,675,23074 min · $4.32

Two snapshots in 74 min for $4.46. The exact-delta gate refused nearly every group, so the submission lands within 0.1% of the template.

On the hidden set

held-out metricreward
shipped weak template87,162,537.500.00
expert C++ reference solver33,824,200.810.60
proved relaxation bound29,919,173.801.00
this run86,063,148.990.0124