Skip to content

test(atlas): cost-aware placement dry-run reference simulator (#8528, F04) - #11274

Merged
dezren39 merged 1 commit into
mainfrom
queue/20168-8528-placement-sim
Nov 17, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/20168-8528-placement-sim

Conversation

@dezren39

@dezren39 dezren39 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

What

Fixture-only, offline reference simulator for the F04 cost-aware placement dry-run (#8528, parent #6020, programme #6018). New isolated test file pkgs/atlas-search/crates/atlas-core/tests/placement_model.rs, the candidate seam named in doc/2026-11-11T03-45-00Z_design_atlas_v2_v4/follow-ons/F04.md.

It compares synthetic placement choices under quality, latency, allowed-location and plan-envelope constraints and emits a reversible proposal with its assumptions. It never executes one. No live pricing, provider bindings, runtime services, credentials or real corpus.

Oracles

  • Hand-calculated unit ledger (documented in the module, computed before the implementation): two equal-quality choices itemised to 125,350,000 micros, a faster choice inside the envelope, a forbidden placement infeasible even at zero cost, a missing price yielding Unknown, insufficient temporary headroom, unmeasured quality not justifying a placement.
  • Invariants (proptest): determinism, unit-preserving sums, monotonic cost under increased nonnegative use, hard-policy dominance over any price, nonnegative input validation.
  • Intentionally-wrong reference: a cheapest-first selector is shown to pick a placement that policy forbids and one that breaks the latency envelope.

Constraints are evaluated before cost and hard policy before everything. Unknown measurement or price propagates as Unknown, never as zero.

Verification

  • cargo test --manifest-path pkgs/atlas-search/Cargo.toml -p atlas-core --test placement_model: 13 passed, no warnings.
  • cargo test ... -p atlas-core --no-run: all atlas-core test targets build.
  • rustfmt applied.

Queue task 20168 (lane any-o).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…6020 F04)

Fixture-only, offline scenario simulator for comparing synthetic
placement choices under quality, latency, allowed-location and
plan-envelope constraints. No live pricing, provider bindings,
autonomous movement, real corpus or credentials; it emits a reversible
proposal and assumptions only.

Failing-first: the hand-calculated unit ledger in the module docs was
computed before the reference calculation and the tests assert its
exact figures. Oracles are the hand ledger, stated invariants
(determinism, unit-preserving sums, input validation, monotonic cost,
unknown propagation, temporary headroom, hard-policy dominance) and an
intentionally naive cheapest-first selector proven wrong on both the
policy and envelope axes.

Constraints are evaluated before cost and hard policy before
everything, so sensitivity, retention, rights and pinned heads are
never overridden by a cheaper price. Unknown measurement or price
yields Unknown, never a guess.

cargo test --manifest-path pkgs/atlas-search/Cargo.toml -p atlas-core
--test placement_model: 13 passed.
@dezren39
dezren39 requested a review from a team as a code owner November 17, 2026 12:02
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T12:02:28.847042Z
We couldn’t complete this review. Comment @codex review to try again.
d43bc86 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.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 951e1a27-8434-40d0-960f-5d34cadb822c
Commits

Reviewing files that changed from the base of the PR and between 57b5195 and d43bc86.

Files selected for processing: 1

  • pkgs/atlas-search/crates/atlas-core/tests/placement_model.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 merged commit 4a21c41 into main Nov 17, 2026
1 check passed
@dezren39
dezren39 deleted the queue/20168-8528-placement-sim branch November 17, 2026 12: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