Skip to content

[AUTOMATED] Compact cold completed-decode cache entries - #208

Merged
sjkim1127 merged 1 commit into
mainfrom
codex/completed-decode-storage
Oct 15, 2026
Merged

sjkim1127 merged 1 commit into
mainfrom
codex/completed-decode-storage

Conversation

@sjkim1127

Copy link
Copy Markdown
Contributor

[AUTOMATED]

Scope

Reduce retained memory in the existing completed-decode cache while preserving every cached result and its fallback/budget semantics.

  • Add an opaque in-process codec for canonical DecodedPcodeFunction in fission-sleigh, using existing bincode/serde dependencies. Every field round-trips; there is no external archive input or persisted format.
  • Keep the existing per-session address map in fission-static. Cold entries hold packed bytes plus a weak reference to the original Arc. First lookup upgrades the live original or restores its exact value, then stores a shared strong Arc and drops the packed bytes.
  • Preserve complete-only admission, first insertion, clone sharing and warm Arc identity. Encoding failure keeps the original representation. Invalid private archives are invariant failures, never silent cache misses. Encoding is outside the shared map mutex; restoration is synchronized per entry with no Rayon, inference, I/O or recursive cache use.
  • No eviction, dropped metadata, decode-budget change, signature/no-return shortcut, worker-policy change, dependency addition or CLI/JSON output-schema change.

This improves storage of the existing FID/consumer shared results. It does not add no-return/FID cross-analysis decode sharing. Querying all functions can still reach the prior expanded-IR memory cost; no uniform memory cap or all-function memory reduction is promised.

Standalone on main 064a857 (PR #207). Draft #203/#204 and DecBench #103 remain separate.

Measured evidence

Three alternating pairs on the same large six-function stripped batch, default workers:

  • Maximum RSS median 3,724,197,888 -> 2,409,381,888 bytes (-35.3%).
  • Whole-batch wall median 32.4801 -> 29.9963 s (-7.6%).
  • CPU median 150.3190 -> 143.7246 s (-4.4%).
  • Five-pair small-batch medians differ by at most 0.3%; Windows/macOS slightly increase. No small-batch speed gain is claimed.
  • Fresh 250/250 stripped requests, 45 cells: zero changed non-time function records. All emitted code, variables/types, addresses, errors/fallbacks and evidence/counters are compared, excluding exactly seven documented duration keys.
  • Repeated focused complete non-time records are deterministic. Pinned Kuna 1.808 comparison still leaves Fission 3.00–11.53x slower; Kuna-level speed is not achieved.

Fresh processes/no persisted result cache; same resources and inputs; no own builds/tests/profilers during timings. OS caches and scheduling are uncontrolled. No guest execution, score/ranking, whole-corpus speed or cross-tool semantic-equivalence claim.

Validation

  • Seven focused tests: full codec field/stop-reason/enum/high-bit/signed/Unicode metadata round-trip and malformed payload rejection; cold/hot lifetime, COW snapshot, live identity, first insertion, incomplete admission, encoding fallback and concurrent shared materialization.
  • 1,838 related nextest tests passed, five skipped, plus crate checks, release CLI, workspace fmt/diff and owner-boundary scan.
  • Remote PR CI must pass separately; it has not been claimed green before submission.

See docs/proposals/2026-10-15-completed-decode-storage.md and docs/validation/completed-decode-storage-performance.{md,json}. Exact hashes, per-run results, coverage bounds and reproduction are included. Full local artifacts: benchmark/artifacts/performance/2026-10-15-decode-storage/.

Datasets

@sjkim1127
sjkim1127 merged commit 533c80c into main Oct 15, 2026
11 checks passed
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