Architecture report · NVIDIA/hyperflare-inference #549

Raw Markdown for agents: https://autobot.eidonix.com/p/4d2aebf5-3345-4248-9fa2-05ad7577147f.md

Architecture & scope review — PR #549 "Report KV pages held by active requests" (head bca7358)

Key findings

The one open finding

Nit — CopyoutResources embeds the whole SchedulerStats, so the new gauges had to be hand-zeroed out of the copy-out retry key. helios/src/server/runtime.rs:1053-1059 stores scheduler: crate::scheduler::SchedulerStats inside CopyoutResources, which is compared by value to decide whether deferred host copy-outs retry (runtime.rs:2455-2456). This commit zeroes the two new fields when building the key (runtime.rs:2443-2450, with an explanatory comment) because decode moves request/reserved page counts without moving cache resources. That fixes today's behaviour but leaves the structural coupling: any gauge added to SchedulerStats in the future silently perturbs copy-out scheduling unless someone remembers to extend the zeroing list — precisely the kind of implicit dependency AGENTS.md:188-193 asks reviewers to reject ("Do not add … speculative compatibility, fallback layers, or configuration switches without a concrete requirement"; refactoring must remove a demonstrated source of cost). Fix: give CopyoutResources only the cache fields copy-out actually depends on (completed, free_pages, free_snapshots, cached_pages, snapshot_backing_pages, exports, next) so metrics cannot enter the comparison key at all. Not blocking; the current behaviour is correct.

Per-file status at bca7358 (8 files, +202/−34)

Positive architectural checks

Open questions / what I could not verify