Skip to content

Optical step actions launch over all track slots: measured cost and a compaction cautionary tale #2458

Description

@austinschneider

Observation with numbers, not a fix proposal: the optical loop's step actions launch over the full track-slot capacity every iteration, and the optical loop is strongly tail-dominated in a scintillator geometry — a handful of diffusing photons keep the loop alive long after most slots are vacant, so most launched threads are empty-slot work.

We prototyped an opt-in thread-slot prefix compaction (partition live tracks to the front, launch over the prefix, periodic full re-partition) on our branch and measured, on a dedicated A30 at 200 events per run with interleaved A/B runs:

  • 8 worker threads: ~7-8% wall improvement.
  • 4 worker threads / window 32 (our production config): 11-15% wall REGRESSION at every partition period we tried (8/16/32) — the partition pass costs more than the empty launches it saves.

So the win is real but configuration-dependent, and a compaction approach needs the partition cost amortized (or a cheaper live-set representation) before it is generally profitable. Also note the interaction we hit and fixed on our branch: actions that write through the track-slot indirection (e.g. detector scoring) must remain compaction-exempt and cover every slot, or scattered physical slots retain stale data.

Sharing in case slot occupancy work is on the roadmap; happy to provide the profile traces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-assistedGenerated/refactored substantially with agentic/LLM AI tools

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions