Skip to content

feat(cost): share physical resources and consume offline evidence - #357

Merged
zzylol merged 9 commits into
mainfrom
codex/empirical-o11y-322
Sep 8, 2026
Merged

zzylol merged 9 commits into
mainfrom
codex/empirical-o11y-322

Conversation

@zzylol

@zzylol zzylol commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Why

Refs #322. Provide shared physical-resource definitions and a conservative offline-evidence path for planning. This PR is the planner library foundation, not the backend-only execution prototype.

Before this PR

The planner lacked a versioned empirical provider and query-matched exact/sketch comparison. Analytical and measured resource fields were defined separately.

After this PR

  • Centralize PhysicalResources<Cpu, Bytes>, ModeledCpu, MeasuredCpu, Measurement, and MeasuredResources in asap-types::resources.
  • Analytical estimates and empirical sketch/exact records reference the shared dimensions: peak/retained memory, scan traffic, serialized size and disk occupancy.
  • Keep modeled CPU operations distinct from measured build/update/merge/prepare/read CPU nanoseconds. Unknown dimensions remain unavailable.
  • Preserve analytical JSON and archived flat v1 benchmark JSON through compatibility adapters; preserve measurement uncertainty and integer byte precision.
  • Add versioned schemas, a minimal synthetic fixture, strict applicability matching, public CostModel integration and fixed-snapshot frequency comparison.

Example: changing compatible update evidence can change candidate ranking; missing, stale or mismatched evidence keeps conservative behavior. A missing preparation measurement is not assumed free for arbitrary algorithms. Observed errors never become formal guarantees.

Scope and related work

This PR contains core code, consumer migrations, schemas, tests and developer documentation (15 files). It contains no benchmark runners, large generated results or synthetic execution benchmarks.

Validation

358 mapping tests and 163 shared-types tests pass. Workspace formatting and strict all-target/all-feature clippy pass. Backend integration against the published shared-resource commit passes 7 integration tests, 633 control-plane tests and 973 data-plane tests.

No automatic issue closure or merge. Earlier large artifact commits remain recoverable in history; review the aggregate Files changed diff.

@zzylol zzylol changed the title feat(cost): plan from offline sketch error and resource evidence feat(cost): share physical resources and consume offline evidence Sep 8, 2026
@zzylol
zzylol merged commit c3410d1 into main Sep 8, 2026
5 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