Skip to content

core: expose running supplied cost in flow snapshots - #15

Merged
pzhin merged 1 commit into
mainfrom
codex/flow-snapshot-running-cost
Aug 22, 2026
Merged

core: expose running supplied cost in flow snapshots#15
pzhin merged 1 commit into
mainfrom
codex/flow-snapshot-running-cost

Conversation

@pzhin

@pzhin pzhin commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • expose exact runningSuppliedCost() for the current in-flight supplied service estimate
  • expose derived completedSuppliedCost() as dispatched supplied cost minus the running gauge
  • update the gauge atomically with dispatch and completion under the scheduler lock
  • document that supplied costs are caller estimates, not actual execution time
  • cover heterogeneous running costs, partial completion, reference equivalence, and snapshot/completion races

Verification

  • ./mvnw --batch-mode --no-transfer-progress verify (re-run after rebase at 2519b7a)
    • 110 core tests and 5 integration tests passed
    • Checkstyle, JaCoCo, SpotBugs, JavaDoc, and artifact-surface gates passed
  • ./mvnw --batch-mode --no-transfer-progress -Pbenchmarks clean verify
    • benchmark discovery and fixture smokes passed
  • ./mvnw --batch-mode --no-transfer-progress -Pjcstress clean verify
    • 168/168 planned executions passed with no failed or error outcomes

JMH before/after

Environment: Apple M4 Pro, macOS Darwin 25.5.0, OpenJDK 21.0.11. Baseline is e49a621; the measured implementation is 18c18fd. Current rebased head 2519b7a has identical core source and tests; the rebase integrated current main documentation and CI changes, with the formal-spec conflict resolved in English. Each point used 3 forks, 5 x 1 s warmups, 8 x 1 s measurement iterations, and the GC profiler.

Workload Before After Change
completeSteady 34.502 ± 0.615 ns/op 37.407 ± 0.673 ns/op +8.42% latency
dispatchOne 249.353 ± 8.899 ns/op 243.457 ± 8.949 ns/op -2.36%; intervals overlap
singleJobCycle, SKEWED_COSTS 1,920,717 ± 21,129 ops/s 1,796,462 ± 52,326 ops/s -6.47% throughput
cycle allocation 2791.773 ± 0.003 B/op 2793.208 ± 0.003 B/op +1.435 B/op

The cycle measures dispatch -> complete -> enqueue in steady state. These are machine-specific measurements, not a service-level claim.

@pzhin
pzhin force-pushed the codex/flow-snapshot-running-cost branch from 18c18fd to 5a9ba5f Compare August 22, 2026 18:40
Let operators distinguish queued estimates, committed in-flight work, and
historical dispatch totals without inspecting scheduler internals. Keep the
gauge exact and atomic with dispatch and completion lifecycle transitions.
@pzhin
pzhin force-pushed the codex/flow-snapshot-running-cost branch from 5a9ba5f to 2519b7a Compare August 22, 2026 19:25
@pzhin
pzhin merged commit 2644117 into main Aug 22, 2026
12 checks passed
@pzhin
pzhin deleted the codex/flow-snapshot-running-cost branch August 22, 2026 20:03
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