Skip to content

v2 complexity.dag rework — well-modeled lens applying v4 modeling discipline (CALIBRATION investigation, brief at /tmp/v2_complexity_lens_brief.md) - #3398

Closed
briansrls wants to merge 1 commit into
mainfrom
session/deep-seal-431
Closed

briansrls wants to merge 1 commit into
mainfrom
session/deep-seal-431

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Auto-opened by session-dashboard for session deep-seal-431.
Pushing to session/deep-seal-431 advances this PR.

Worker attestation

Before flipping this PR to ready for review, confirm each item:

  • Title describes the change (not the session id or branch).
  • PR body summarises what and why (replace the TODO below).
  • Tests run: name the command (e.g. npm test, cargo test) and the result.
  • If this closes a work item, the body contains a Closes #N directive.
  • No commits on this branch are surprises (no fork/cherry-pick I did not make).
  • No secrets / credentials / large binaries staged.

Summary

TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.

Test plan

  • TODO: list the commands that ran (or "no tests changed; relied on CI") and the outcome.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review metadata

  • Provider / model: codex / unknown
  • Commit: 1f8d55e2 · Trigger: schedule
  • Thinking: 269s wall

BLOCKING (3)

Root Cause

  • src/v2/complexity.dag asymptotic class is being modeled as a new local enum rather than projected through std.induction.CostBound/ProductBound → reuse the existing bound carrier or add a valid dissolution-tagged bridge with a concrete trigger.
  • src/v2/complexity.dag ComplexityBound lacks structural product/log-factor coordinates even though CostBound already has ProductBound factors → represent polynomial and log factors structurally or keep classification on normalized CostExpr/CostBound.
  • src/v2/complexity.dag near-miss semantics are encoded both in discharge_complexity_lens_tdd_case and again at the table call site → keep the expectation semantics in one place and call the case directly.

⚠️ The PR introduces a duplicated, under-modeled complexity-bound carrier and a concrete false TDD table result, so it needs rework before merge.

Comment thread src/v2/complexity.dag
// Node -> Witness<ComplexityBound> via cost_of_expr + asymptotic projection.
// =========================================================================

type ComplexityBound

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BLOCKING: ComplexityBound adds a new substrate coproduct without the required 🟢/🟡/🔴 tag and duplicates the existing std.induction.CostBound asymptotic-bound algebra instead of grounding in it (INVARIANTS P1/P5, MODELING M9).

Comment thread src/v2/complexity.dag
BoundLinear => BoundQuadratic
BoundQuadratic => BoundPolynomial { degree: 3 }
BoundPolynomial { degree: d } => BoundPolynomial { degree: d + 1 }
other => other

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BLOCKING: The new multiplication projection underestimates O(n * log n): BoundLinear times BoundLog falls through to BoundLog instead of BoundLinearithmic, so classify_complexity can report a lower class than CostExpr proves (INVARIANTS P1/P3).

Comment thread src/v2/complexity.dag
&& discharge_complexity_lens_tdd_case(case: complexity_lens_tdd_linear_pass())
&& discharge_complexity_lens_tdd_case(case: complexity_lens_tdd_quadratic_fires())
&& discharge_complexity_lens_tdd_case(case: complexity_lens_tdd_unknown_advisory())
&& !discharge_complexity_lens_tdd_case(case: complexity_lens_tdd_near_miss())

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BLOCKING: complexity_lens_tdd_table_passes negates the near-miss case even though ExpectNearMiss already discharges as !matches, making the table fail when the near-miss behaves correctly.

@briansrls

Copy link
Copy Markdown
Contributor Author

Closing per operator wrap-up directive 2026-05-20. Worker deep-seal-431 is archived; closing on their behalf as PM. Branch stays in place.

@briansrls briansrls closed this May 20, 2026
@briansrls
briansrls deleted the session/deep-seal-431 branch June 1, 2026 18:42
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