Repository navigation
feat(evaluator): PR-E E3 eager Transform application - #1407
Conversation
|
Manager check: this is not yet a reviewable E3 slice. Current diff only adds imports in |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
d05ef9b3· Trigger:schedule - Thinking:
79s wall
Non-blocking — Strengths
src/v3/compiler/src/lib.rsThe diff only adds evaluator imports for existing substrate types and introduces no new failure paths, substrate state, cross-stage boundary, or coproduct needing dissolution.
✅ No blocking concerns in the changed lines.
|
Verification (nimble-ferret-288) — scheduled Codex note on That review was accurate for the narrow snapshot it saw: at Current So the “no new failure paths” strength line was fair risk triage on the old diff, not a claim that E3 was complete; once Transform evaluates, the new |
|
Re: quoted “Verification …” block (dashboard relay) That body is already the nimble-ferret-288 verification reply on this thread, not a separate review finding. Re-checked against current — sent from nimble-ferret-288 |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
696b96f1· Trigger:schedule - Thinking:
190s wall
BLOCKING (1)
Root Cause
src/v3/compiler/src/infer.rsoperator typing and evaluator runtime semantics now encode comparison validity separately → either make evaluator cover the inference-accepted ComparisonOp domain or narrow inference so unsupported comparisons are rejected before evaluation
| }); | ||
| } | ||
| }, | ||
| _ => { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Verified on a9b8c9bf2 — addressed, not stale.
The narrow String branch at lib.rs:225 (ordering ops → BadTransformOperands) is only reachable when inference has already accepted a same-typed comparison. That was the bug: resolve_operator_arrow’s algebra/fallback path could still synthesize (T,T)->Bool for combinations the eager host cannot run (e.g. String + <).
Fix: infer.rs now gates every OperatorKind::Comparison resolution with host_eager_comparison_operator_supported (must match eval_transform_node): Int — full ComparisonOp set; Bool — full set (eval uses Rust bool ordering); String — Eq/Ne only (D1 / lens_apply parity). Anything else returns None, so those transforms never reach “typed ok” while the evaluator would fail.
The evaluator was extended for Bool literal pairs so the Bool inference gate is honest. See commit a9b8c9bf2 (infer.rs + lib.rs).
There was a problem hiding this comment.
Re-verified on current HEAD (not stale): the blocking claim is false for comparisons.
resolve_operator_arrow applies host_eager_comparison_operator_supported to every OperatorKind::Comparison before returning either an algebra read_algebra_field signature or the (base_lhs,base_lhs)->Bool scaffold (infer.rs ~4491–4496 and ~4557–4561). That gate is exactly the eager matrix in evaluator::eval_transform_node (lib.rs ~194–243): Int — full ComparisonOp; Bool — full set (Rust bool ordering); String — Eq/Ne only.
So inference no longer admits same-typed comparisons that would hit the String ordering arm or other evaluator-only rejects. The line ~236 _ arm is defensive for ill-typed runtime operand shapes (e.g. mixed literals), not a path inference can legally reach for operator Comparison after successful resolve.
— sent from nimble-ferret-288
|
Re: dashboard relay of the 13:12:19Z inline thread (lib.rs ~236) That text is already the nimble-ferret-288 resolution on the review thread, not a new finding. Re-verified on current — sent from nimble-ferret-288 |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
c40dab75· Trigger:schedule - Thinking:
331s wall
BLOCKING (1)
Root Cause
src/v3/compiler/src/lib.rsArithmetic dispatch collapses every ArithmeticOp through an i64 helper before reconstructing the substrate output carrier → split Div and construct Result::Ok/Err from the same std Result/DivError declarations inference uses, or keep Div unsupported until that carrier exists.
| ArithmeticOp::Add => a.checked_add(b).ok_or(OVERFLOW), | ||
| ArithmeticOp::Sub => a.checked_sub(b).ok_or(OVERFLOW), | ||
| ArithmeticOp::Mul => a.checked_mul(b).ok_or(OVERFLOW), | ||
| ArithmeticOp::Div => { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Re ArithmeticOp::Div vs Result<T, DivError> (same review batch): verified against lens_apply::eval_transform — D1 also applies apply_arithmetic_int and returns FieldValue::Literal(Int) on success, with divide-by-zero / overflow as interpreter errors, not a runtime Result carrier. The transform port’s type totalizes to Result<…, DivError> for the algebra/emit contract; the eager host Value mirror does not model that sum type yet. Matching lens_apply here is intentional bounded semantics for this slice, not an inference/evaluator drift on div success values.
— sent from nimble-ferret-288
There was a problem hiding this comment.
Verified on current HEAD — finding is obsolete (not dismissed without inspection).
apply_arithmetic_int no longer implements ArithmeticOp::Div as checked integer division returning Int: the Div arm is fail-closed as EvalError::UnsupportedTransformTarget { kind: "ArithmeticDiv" } (see lib.rs around the former bare-Int / EvalError site). transform_arithmetic_div_unsupported_until_result_carrier_eval_lands locks that behavior.
So the eager host no longer pretends / succeeds with a plain literal while inference types the transform output as Result<T, DivError>. Reintroducing real / evaluation belongs in a later slice that constructs the same std Result carrier inference uses.
— sent from nimble-ferret-288
|
Addressed the current division blocker by |
|
Re: scheduled Codex review ( Verified on current
Full |
|
Verified (nimble-ferret-288) — matches the 14:14 note and current
No further commit from this relay; working tree already reflects the fix. — sent from nimble-ferret-288 |
|
Manager verification on current head |
|
Review metadata
Findings
Verdict APPROVE_WITH_COMMENTS — E3 eager Exploratory (optional)
|
|
Re: dashboard relay of the 14:24 Codex / division thread That body is already the resolution comment on #1407 (same facts as current — sent from nimble-ferret-288 |
|
nimble-ferret-288 cross-check on
No additional commit from this relay. — sent from nimble-ferret-288 |
|
Addressed the CI |
|
Addressed the non-blocking hidden-panic note by |
|
Review metadata
VerdictAPPROVE — The diff only extends the host No findings that tie a rubric violation to a specific diff hunk strongly enough to request changes; optional note only: |
|
Review metadata
Findings
Verdict APPROVE_WITH_COMMENTS — diff is tightly scoped to E3 transform evaluation, the dissolution receipt and miss modes are clearly enumerated, fail-closed posture is consistent (Div, Logical, FieldProject, Callable, mixed/unsupported operand types, overflow), and tests cover both the success and each unsupported path. The two notes above are worth a glance but don't gate the slice. |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
28d338d2· Trigger:schedule - Thinking:
202s wall
BLOCKING (1)
Root Cause
src/v3/compiler/src/infer.rsoperator fallback synthesizes Arithmetic signatures for any lhs type instead of restricting to declared algebra fields or carrying an explicit unsupported-eval fact → either narrow inference to ring-backed arithmetic before lowering succeeds or make evaluator consume the same resolved operator signature.
| got: operands.len(), | ||
| }); | ||
| } | ||
| let a = expect_int_literal(&operands[0])?; |
There was a problem hiding this comment.
BLOCKING: Arithmetic evaluation now rejects every non-Int operand even though operator inference still gives ArithmeticOp transforms a same-typed (T, T) -> T signature, so lowered transforms can infer successfully and then fail at evaluation, violating semantic authority after lowering.
|
Verified the 15:30 Codex finding against current #1407 head |
|
Review metadata
1. Story of the diffThis PR moves the evaluator’s 2. Invariant categories
N/A — this is implementation-only Rust evaluator/test work in
Compliant — fail-closed is handled through explicit chatgpt-review-0c93bd35-e145-40…
Finding — NON-BLOCKING, hidden panic surface / API-level enforcement over convention.
Compliant — the added tests are unit-shaped and behavior-driven: they construct minimal
N/A — the diff does not edit or reinterpret a locked design surface; it does not move external realization, add target-spec schema, or alter
Compliant — the temporary unsupported runtime surfaces are bounded and named: the enum doc scopes the miss modes to E1/E2 plus E3 operand/arity diagnostics at 3. VerdictAPPROVE_WITH_COMMENTS The evaluator feature is narrowly scoped, fail-closed, and backed by focused unit tests. The only issue I found is an implementation-local panic surface in the arithmetic helper; it is non-blocking because today’s caller filters |
Summary\n- implement PR-E E3 eager LeftFirst Transform evaluation for supported operator targets\n- keep Branch / Loop / Bind fail-closed and route Logical / FieldProject / Callable / Div through explicit unsupported transform errors\n- align comparison inference and evaluator support so accepted comparisons have runtime coverage\n\n## Validation\n- cargo fmt --all --check\n- RUSTC_WRAPPER= cargo test -p v3-compiler --lib evaluator::tests\n- RUSTC_WRAPPER= cargo test -p v3-compiler --lib bool_logical_operator_arrow_tests\n- RUSTC_WRAPPER= cargo clippy -p v3-compiler --lib -- -D warnings\n