Skip to content

Add flip budgets, priced movement, and regime simulations - #13

Merged
soodoku merged 1 commit into
mainfrom
flip-budget-and-regimes
Oct 7, 2026
Merged

soodoku merged 1 commit into
mainfrom
flip-budget-and-regimes

Conversation

@soodoku

@soodoku soodoku commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Why

The paper compared Queue Shift with NFR interpolation at matched queue movement only. That drops the negative-flip protection interpolation exists to provide: movement-only Queue Shift flips 12–16% of incumbent-correct cases even at zero movement, where interpolation flips none.

What changes

  • Flip control: a per-case weight (raw churn, or expected negative flips = candidate probability that the incumbent was right). Hard budget is solved as an exact MILP (HiGHS, zero gap); penalty keeps a pure min-cost flow.
  • Priced movement: queue_costs makes cases a currency (hours, money). Added work beyond each queue's incumbent load is priced; freed capacity earns no credit.
  • Queue prices: the flow optimum is a per-queue threshold rule; the solver returns the dual prices.
  • Regime simulation (4 mechanisms × 4 batch regimes × 30 trained pairs): holding queue totals costs 0.3–0.8pp when updates reorder cases, 4.7–6.5pp when they move volume; learned prices come within 1.6pp of exact but break the budget in 50–93% of batches.
  • Paper rewritten around these results; appendix after references with A.n numbering.
  • Breaking: solve_assignment takes incumbent labels instead of loads.

Checks

make check passes locally (ruff, pyright, pydoclint, 47 tests, build, formal checks, generated-output sync, paper build). The new solver modes match exhaustive search; removing either new constraint fails the tests. Re-running the existing estimated and oracle experiments reproduces the old movement-only numbers exactly.

🤖 Generated with Claude Code

Queue Shift previously matched NFR interpolation on queue movement only, which
silently dropped the negative-flip protection the baseline exists to provide.
The solver now also caps (MILP) or penalizes (min-cost flow) case churn or
expected negative flips, prices movement per queue so budgets can count cases,
hours, or money, and returns per-queue dual prices from the flow form.

A regime simulation maps when holding queue totals is costly (updates that move
volume) versus nearly free (updates that reorder cases), and compares learned
queue prices with exact per-batch assignment. The paper is rewritten around
these results; all tables and figures are regenerated.

Breaking: solve_assignment takes incumbent labels instead of incumbent loads.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 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-10-07T05:33:54.094429Z 2cf9659 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.

@soodoku
soodoku merged commit 930c8f3 into main Oct 7, 2026
9 checks passed
@soodoku
soodoku deleted the flip-budget-and-regimes branch October 7, 2026 05:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2cf96596d9

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +64 to +68
unit_costs = np.asarray(queue_costs, dtype=float)
if unit_costs.shape != np.shape(queue_loads):
raise ValueError("queue_costs must contain one cost per queue")
added = np.maximum(np.asarray(queue_loads) - np.asarray(incumbent_loads), 0)
return float(unit_costs @ added)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject invalid costs in workload_shift

When the newly exported workload_shift helper is called directly with negative, NaN, or infinite queue costs, it returns a negative or non-finite workload instead of rejecting the input. These values are explicitly invalid in solve_assignment, so the public helper can otherwise produce a nonsensical budget that callers may persist or reuse; validate that every converted cost is finite and nonnegative here as well.

Useful? React with 👍 / 👎.

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