Concepts and Evidence¶
Why host time is not model time¶
An emulated operation takes host wall-clock time, but that duration includes:
- host CPU generation and load;
- scheduler pre-emption;
- QEMU acceleration mode;
- dynamic translation and caching;
- Python or daemon implementation overhead;
- logging and tracing;
- unrelated work on the host.
Those effects describe the machine running the emulator. They do not describe the target NIC, switch, GPU, BMC, bus, or facility controller. Scaling all host times by one constant does not fix this because different workloads change the mix of translation, I/O, queues, memory, and host scheduling.
Why QEMU icount is necessary but insufficient¶
QEMU icount maps executed guest instructions to deterministic virtual time:
[ t_{\mathrm{guest}}=I \times 2^N\ \mathrm{ns}, ]
where (I) is the instruction count and (N) is the selected shift.
This gives the guest CPU a repeatable clock. It does not assign service time to PCIe transfers, DMA, device queues, interrupts, links, switches, accelerator memory, kernels, or contention. QEMU explicitly documents instruction counting as distinct from cycle-accurate microarchitecture simulation.
Cnuas therefore keeps instruction time as one component input and models every other resource explicitly.
The three evidence classes¶
| Class | Question answered | Permitted interpretation |
|---|---|---|
| Functional | Did the operation behave correctly? | Interface and state-transition evidence |
| Analytic virtual time | What does this named profile estimate? | Deterministic model result for stated assumptions |
| Calibrated prediction | How well does the model predict this named target? | Target-specific result with held-out error |
These classes must not be collapsed:
- A passing driver test does not validate timing.
- A deterministic result is not automatically a physical prediction.
- A fitted model is not validated until separate observations have been scored.
- One calibrated packet shape or tensor shape does not calibrate all workloads.
Why one cross-component model¶
A single end-to-end operation can include:
- guest instruction execution;
- PCIe transfer;
- CnuasNIC packet service;
- one or more CnuasSwitch hops;
- CnuasLink transfer;
- CnuasGPU memory and compute;
- BMC or ORV3 management traffic;
- facility telemetry and power roll-up.
Independent component numbers cannot reveal where jobs wait when resources are shared. The common scheduler assigns each stage to a named component, retains per-lane availability, and produces one ordered event trace.
Why integer picoseconds¶
Rates such as 100 Gbit/s can produce fractional nanoseconds. The scheduler converts service time to integer picoseconds and rounds upward. This provides:
- deterministic comparisons;
- stable equal-time ordering;
- no cumulative binary floating-point drift in queue availability;
- enough resolution for high-rate links while retaining simple integer state.
Profile arithmetic remains readable in nanoseconds. Only scheduled timestamps use picoseconds.
Why calibration is component-specific¶
A global ratio such as "10 Cnuas PPS equals 1 hardware PPS" hides the resource that caused the difference. It can fail as soon as packet size, queue count, flow count, link speed, tensor shape, concurrency, or firmware changes.
Cnuas instead calibrates a named component for a named target:
[ t_{\mathrm{physical}}=\max(0,\alpha t_{\mathrm{analytic}}+\beta). ]
The scale (\alpha) corrects proportional error. The offset (\beta) corrects fixed overhead. Held-out residuals determine whether this form is adequate.
Design decisions¶
| Decision | Reason |
|---|---|
| Explicit work dimensions | Prevents device-specific assumptions from leaking into pipelines |
| Strict profiles | A misspelled field fails instead of silently becoming zero cost |
| Serial and overlap modes | Represents sequential work and bottleneck resources without a complex DSL |
| Stable earliest-lane scheduling | Makes parallel service and tie-breaking repeatable |
| Affine first calibration | Gives an inspectable baseline before adding non-linear models |
| Separate fit and validation commands | Prevents training error from being reported as prediction error |
| Offline first release | Establishes model semantics before coupling multiple emulator clocks |