One optimizer, two arms
Earlier study (C = 8). This page covers the first study: one sector, eight channels, the geometric workload and the ring only (models v1 to v3). The paper’s results – the three-sector ray-traced site, one ring and one pool – are on Results: ring and pool.
Status: v3 results, replayed. The metrics are pysim’s with the search units as built and measured at
RTL (cache v3); the clock is each tool step’s measured time (Vitis HLS / Vivado / xsim 2025.1).
examples/aoa_detect/dse/replay.py. The experiment’s design is below (The experiment); this section
is the current result, and the sections after it are the v2 history.
v3: the search units as built
What changed since v2 (the lab’s lab/engine-fed* branches):
- The search unit is built and measured on the fed
SystolicEngine. At RTL, a search takes 1,715 cycles after the block at 16 × 16, and 3,980 plus a 256-cycle intake at 8 × 8. v2 had about 600 and 1,880, from the array alone. - Its resources are implemented (Vivado, out of context at 4 ns): 106,780 LUT and 1,066 DSP at 16 × 16, 37,289 LUT and 291 DSP at 8 × 8. The 16 × 16 unit misses 4 ns by 1.1 ns, on a path the lab can remove. Implementing it takes 2.1 hours.
- xsim with the real units runs at 537 cycles/s, 19.5 times slower than with stand-ins. A design on 5,000 blocks takes up to 5.4 hours at RTL.
- RTL is pysim. The whole DUT at RTL with two real 16 × 16 units matched pysim to 0.04% of p99 and
0.7% of p50 on 305 results (
examples/aoa_detect/dut_real.json). So v3 has no biased stand-in: the replay measures cost only, and pysim’s error is the measured one.
The design is short of compute. Only three designs miss less than 1% of detections on 5,000 blocks, at a 16-slot ring and a p99 of 15 blocks. So the replay scores two objectives:
- soft: J = p99 × (1 + loss / 1%), every design acceptable;
- hard at 5%: the lowest p99 among designs missing at most 5%.
Each runs at the resource levels where a design qualifies. The optimum:
| Resource level | Optimum (soft) | p99, cycles (95% interval) | Missed |
|---|---|---|---|
| 30% | one 16 × 16 unit, a 4-slot ring | 6,772 (6,769 to 6,814) | 17% |
| 50% | one 16 × 16 unit, an 8-slot ring | 6,772 (6,769 to 6,811) | 17% |
| 80% (hard at 5%, from 60%) | two 16 × 16 units, a 4-slot ring, catch-up | 7,344 (7,274 to 8,138) | 4.6% |
The arms on the 5,000-block trace, p99: 30 seeds, TPE, one confirmation at RTL; hours are medians.
Re-run 2026-11-30 with the ring counted in block RAM (space.ring_ramb36, as the lab implemented it;
before, URAM): every optimum and every median regret is unchanged; 72 designs change band, so TPE’s paths
and the hours shift by up to 15%.
| Arm | Soft, 30 / 50 / 80% | Optimum found (tied) | Hard at 5%, 60 / 80% | Optimum found (tied) |
|---|---|---|---|---|
| RTL, 5,000 blocks | 47 / 88 / 273 h | 100 / 97 / 100% (100 / 97 / 100%) | 211 / 275 h | 100 / 100% |
| RTL, 2,000 blocks | 25 / 44 / 119 h | 100 / 0 / 0% (100 / 0 / 100%) | 92 / 114 h | 0 / 0% |
| RTL, 1,000 blocks | 17 / 26 / 66 h | 100 / 0 / 100% | 54 / 66 h | 100 / 100% |
| RTL, 500 blocks | 13 / 18 / 40 h | 100 / 0 / 100% | 33 / 39 h | 100 / 100% |
| pysim, TPE | 8.4 / 8.7 / 12 h | 100 / 97 / 100% (100 / 97 / 100%) | 11.7 / 12 h | 100 / 100% |
| pysim, the whole space | 8.6 / 9.4 / 14 h | 100% | 13.5 / 14 h | 100% |
| RTL, random | 23 / 66 / 258 h | 27 / 30 / 23% | 184 / 258 h | 23% |

The soft objective on the 5,000-block trace: the share of 30 runs that, stopped at that time and confirmed, would pick a design within 5% of the best. The hours are on a log axis; the dot is each arm’s median end.
- Synthesis and implementation are 5.2 hours in every arm, most of it the two search units’ implementation (2.1 hours and 37 minutes). The rest is simulation, calibration and confirmation.
- On the 5,000-block trace, RTL simulation dominates: 42 to 270 hours a level for RTL with TPE, against 0.4 to 1.3 hours of calibration and pysim. pysim with TPE is 5.6 to 23 times faster for the same picks. One confirmation at RTL is 2.9 to 5.4 hours of its 8 to 12.
- pysim of the whole space answers every level from one sweep, in 14 hours. RTL with TPE needs 47 + 88 + 273 = 408 hours for the three levels.
- Short RTL traces are cheaper and still mislead. 2,000 blocks never finds the optimum under the hard objective (regret 2.1). Under the soft one it misses at 50%. 500 and 1,000 blocks do better on this trace, by luck of where its tail falls: which short trace misleads depends on the workload.
- Ties. The bootstrap interval on p99 at 5,000 blocks is narrow (under 1% at 30 and 50%, 11% at 80%), so “optimum found” and “tied with the optimum” mostly agree.
On a 500-block trace, scored by p90 (the honest metric for that length; p99 on 400 searches is the 4th-largest time):
| Arm | Soft, 30 / 50 / 80% | Hard at 5%, 60 / 80% | Optimum found |
|---|---|---|---|
| RTL, 500 blocks, TPE | 9.8 / 15 / 34 h | 28 / 33 h | 90 to 100% |
| pysim, TPE | 5.8 / 5.8 / 6.3 h | 6.2 / 6.3 h | 90 to 100% |
| pysim, the whole space | 5.8 / 6.0 / 6.5 h | 6.4 / 6.5 h | 100% |
At this length the gap is 1.7 to 5.7 times, most of the floor being the 5.2 hours of synthesis both arms pay. The long trace is where the difference grows. It is also the trace the metric needs.
What v3 does not yet show.
- pysim is RTL here, to its measured 0.04% on one design. The replay tests cost, not pysim’s accuracy across the space: one RTL point, plus the per-block calibrations, carries that claim.
- The 16 × 16 unit does not close at 4 ns until the lab’s fix lands; the space keeps it.
- The clock is serial. Synthesis, implementation and RTL runs parallelize across machines, and pysim across cores.
v2 (superseded): the analytic search unit
The sections below are the v2 replays: analytic search units, and RTL stood in for by pysim with biases.
The experiment
Both arms start with nothing synthesized or calibrated, and run the same optimizer: Optuna’s TPE
(TPESampler, multivariate, constrained), minimizing p99 subject to a resource level $\le L$ (the
largest fraction of any resource type) and at most 1% of the golden’s detections missed. It runs one
study per level, at levels $L$ of 40%, 50% and 100%. There are 30 seeds per arm and level, and 150 trials
per study.
Each trial is one design:
- Synthesis: csynth and implementation of every block configuration the design needs that has not been built yet. A configuration is a capture variant, an engine size, the vector unit, a controller, a stream block or a crossbar. Both arms pay this, and it gives the design’s resources.
- If the design does not fit under $L$, the trial stops. The optimizer is told the trial is infeasible, and nothing is simulated.
- Otherwise, the design is measured, which differs per arm:
- RTL: the design’s DUT top csynth, its system top, elaboration and xsim of the trace;
- pysim: the calibration of each block configuration not yet calibrated (once), then pysim’s seconds.
Each arm’s optimizer sees its own measurements.
An arm that explores with a model or a short trace ends with an RTL confirmation:
- its five best designs, by its own measurements, are run at RTL on the full trace;
- designs it measured alike count once;
- the best of the five that meets both constraints at RTL is its pick.
The confirmations are charged.
The clock. Every step is charged its measured seconds (Vitis HLS / Vivado / xsim 2025.1, 8 cores; the
lab’s calib_cost.json, Part E, the flow’s cost). Steps run serially:
| Step | Seconds | Arm |
|---|---|---|
| csynth: capture variant / engine 8 × 8 / 16 × 16 / vector unit / controller | 22 / 68 / 511 / 36 / 18 | both |
| Implementation, a block / the crossbar with the ring’s adaptor | 150 / 180 | both |
| Calibration: capture / engine 8 × 8 / 16 × 16 / vector unit / controller | 40 / 109 / 363 / 160 / 9 | pysim |
| A design at RTL: DUT csynth + system top + elaboration | 37 + 27 + 16 | RTL, confirmations |
| xsim, 200 blocks, 2 to 8 units | 44 to 70 | RTL, confirmations |
| pysim, 500 blocks | about 4.6 (measured per design) | pysim |
The score is the pick’s true p99 over the best true p99 at the level, among the designs that meet both constraints.
The arms:
| Arm | Explores with | Then |
|---|---|---|
| RTL, 500 blocks | TPE, RTL of the full trace | – |
| RTL, 200 / 100 / 50 blocks | TPE, RTL of the trace’s first $N$ blocks | confirms five |
| pysim, TPE | TPE, pysim of the full trace | confirms five |
| pysim, the whole space | no optimizer: every block configuration built and calibrated, every design that fits simulated | confirms five |
| RTL, random | random designs, RTL of the full trace | – |
The RTL stand-in
RTL is pysim with biases (oracle.py). There are two stand-ins:
| Stand-in | Biased |
|---|---|
truth (v2) |
every block: the systolic unit 15% slower and at 8 lanes, the vector unit’s tail +40%, the controller +2 cycles a message, the crossbar at 512 bits |
truth_meas |
only what no RTL run has measured: the systolic unit (15% slower, 8 lanes) |
The two give the same conclusions to within a few percent. The gap between pysim and the stand-in is the systolic unit’s.
Results (truth_meas)

The share of 30 runs that, stopped at that time and confirmed, would pick a design within 5% of the best at RTL. The dot is each arm’s median end. The table is below.
| Arm | Level | Hours | Synthesis | Simulation, calibration, confirmation | Optimum found | Failed pick |
|---|---|---|---|---|---|---|
| RTL, 500 blocks | 40 / 50 / 100% | 5.8 / 5.5 / 8.2 | 2.5 | 3.3 / 3.1 / 5.7 | 83 / 93 / 100% | 13 / 0 / 0% |
| RTL, 200 blocks | 4.9 / 4.7 / 6.5 | 2.5 | 2.4 / 2.2 / 4.0 | 20 / 80 / 7% | 73 / 17 / 0% | |
| RTL, 100 blocks | 4.5 / 4.4 / 5.6 | 2.5 | 2.1 / 2.0 / 3.1 | 10 / 53 / 0% | 87 / 40 / 0% | |
| RTL, 50 blocks | 4.3 / 4.2 / 5.3 | 2.5 | 1.9 / 1.8 / 2.8 | 23 / 50 / 0% | 73 / 40 / 0% | |
| pysim, TPE | 3.2 / 3.2 / 3.4 | 2.5 | 0.7 / 0.7 / 0.9 | 60 / 83 / 47% | 17 / 0 / 0% | |
| pysim, the whole space | 3.4 / 3.4 / 3.8 | 2.5 | 0.9 / 0.9 / 1.3 | 100 / 100 / 100% | 0 | |
| RTL, random | 5.8 / 6.1 / 9.7 | 2.5 | 3.3 / 3.6 / 7.2 | 43 / 23 / 23% | 33 / 20 / 0% |
- Synthesis is the floor, and both arms pay it. All 54 block configurations are built in every arm within about 50 trials: 2.5 hours, two-thirds of it the capture’s 24 variants and the 16 × 16 engine. Under this protocol, the most a model can save is the simulation.
- RTL on the full trace is reliable and slow: 3 to 6 hours of simulation on top of synthesis, for each level separately.
- Short RTL traces are cheaper and mislead: the losses of 50 to 200 blocks rank catch-up-off designs as lossless that miss 1.2 to 4% on the full trace. The shortlist often holds no design that passes.
- pysim with TPE is the fastest arm, and inherits the model’s error. pysim ranks designs by the systolic unit’s analytic time, and the stand-in’s unit is 15% slower and at 8 lanes. Near the 1% line that flips which designs pass: at 100%, pysim’s top three pass in pysim and miss 1.2 to 2.2% at RTL, and the optimum is its fifth. TPE never measures the designs that would correct it.
- pysim of the whole space wins on both axes. Once each block is calibrated, simulating every design costs 0.3 to 0.6 hours. The confirmation then picks the optimum at every level, because the shortlist is drawn from the whole space, not from what an optimizer happened to visit. One sweep answers every level: 3.8 hours for the front, against 5.5 to 8 hours a level for RTL with TPE.
What this does and does not show
- It is about cost, with the search held fixed. The same optimizer and the same seeds run in both arms; only what a measurement costs, and how exact it is, differs.
- The stand-in’s error is a hypothesis. It is the systolic unit, which the lab is measuring now
(
plans/systolic_engine_fed.md). Once it is calibrated, pysim’s ranking should follow RTL as closely as the whole DUT already does (0.2% of p99, the flow’s cost). The pysim-with-TPE arm’s misses should then fall to the shortlist’s few, and the replay will be rerun on a table measured at RTL. - The clock is serial. Synthesis and RTL runs parallelize across machines; pysim sweeps across cores. The proportions hold, the hours do not.
- The shortlist of five is a choice. A longer one costs more RTL time and catches more of a model’s misranking.
Rerun:
pip install -e ".[dse]"
python -m examples.aoa_detect.dse.replay --rtl truth_meas