Skip to content

perf(csa): coalesce immutable proposal issuance - #117

Merged
isty2e merged 3 commits into
mainfrom
perf/csa-proposal-state-transitions
Sep 26, 2026
Merged

isty2e merged 3 commits into
mainfrom
perf/csa-proposal-state-transitions

Conversation

@isty2e

@isty2e isty2e commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Change

Coalesce queue advancement, proposal-ID allocation, and pending/generation registration into one immutable issuance operation. An ordinary queued proposal now constructs one CSAEngineState instead of three, and one GenerationRuntimeState instead of two.

Generation materialization still commits selection, trace, and RNG once per generation. Sampling validation, batch-end provenance binding, ask()/tell() behavior, and checkpoint formats are unchanged. This does not remove pending-registry copying or change its complexity.

Regression coverage exercises custom emission hooks, partial feedback, failed issuance, candidate identity, interleaved state forks, and checkpoint/exact-async continuation. After integrating current main, all 32 comparison cases still match the baseline's proposals, state, RNG, trace, and bank-update results.

Hook Migration

CSAOptimizer.propose_candidate(state) is replaced by emit_proposal(state), returning (proposal, tracks_generation, planned_provenance, state). Overrides must return a fully issued Proposal and a state that already owns its ID and pending registration. Generated children must also advance the queue and register their generation ID. Leave provenance binding to ask().

No compatibility shim is retained: the old hook exposed a dequeued but unissued state and required separate allocation and registration transitions. The new hook makes issuance one operation. The migration is documented in the changelog and method docstring.

Measurements

The following are pre-integration measurements against 6c65fa5c of the issuance implementation committed in 9ce98895. They are not fresh timings of the merged PR head; the 32-case equivalence check was rerun after the merge.

Steady ask/tell time per 70 observations, batch size 1, crowding and trace disabled:

Space Before After
Scalar real 5.182 ms 4.374 ms
Four real leaves 6.198 ms 5.733 ms
Four integer leaves 6.049 ms 5.347 ms
Mixed record 8.200 ms 7.772 ms

The full panel crosses these four shapes with batch sizes 1/8, crowding off/on, and trace off/on: 32 cells, bank capacity 8, seed 11, and two completed generations. Runs were sequential in A/B/B/A order, with two warmups and seven samples per cell per run. The table uses pooled medians of 14 samples per revision; no samples from those four runs were removed.

Across the 32 cells, the median of the per-cell steady-time reductions was 6.9% (range 0.3–15.6%). Initial-bank-inclusive time fell by a median 5.8%. Within-run relative MAD medians were about 2–3%. The unchanged frozen-input bank replay moved by a median 1.4% (range -6.5–5.8%), indicating residual timing noise.

Workloads use CSAOptimizer.from_space_defaults with bank growth capped at 8 and only the far-update mode varied for crowding. Real bounds are [-5, 5]; integer bounds are [-8, 8]. The mixed record contains four real leaves, one integer, and a three-choice category. Objectives use squared numeric values, position-weighted sums for arrays, and category indices, without added delay. Timing includes objective calls, observation construction, validation, RNG work, configured trace recording, and result retention; setup, checkpoint serialization, hashing, and instrumentation are outside the timed region.

Environment: macOS arm64, Python 3.11.0, NumPy 2.4.6, SciPy 1.17.1, joblib 1.5.3, and cloudpickle 3.1.2; default GC and native thread limits set to 1. The host had substantial competing load, so these are provisional small-bank results, not a universal speedup claim. No peak-memory improvement or comparison with legacy CSA is claimed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-26T06:55:50.010861Z 12b3282 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@isty2e
isty2e merged commit 9ddfa62 into main Sep 26, 2026
8 checks passed
@isty2e
isty2e deleted the perf/csa-proposal-state-transitions branch September 26, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant