Repository navigation
fix(smt,#3801): Z3-Python-06 Pareto-front enumeration returned dominated points - #7912
Merged
Merged
Conversation
…TED points
enumerer_front_pareto (cell 10) called opt.maximize(qualite) but NEVER minimized
cout. Z3 then returned an arbitrary cost in [2*qualite, cout_precedent-1]. The
committed output printed a "Cout min = 2*q" column showing 6 of 9 points had
Cout > Cout min — e.g. point 3 = (qualite=8, cout=17) while (8,16) is feasible,
so (8,17) is DOMINATED by (8,16) (same quality, strictly lower cost).
Yet cell 13 markdown claimed "Chaque point est Pareto-optimal : aucun point
n'est domine" — directly refuted by the cell's own output. cell 11 compounded
this with a FALSE pedagogical defense ("plusieurs couts sont Pareto-equivalents")
— but (8,16) DOMINATES (8,17); they are NOT Pareto-equivalent.
A second bug amplified it: the dedup "keep first point per quality" kept the
arbitrary (high) cost and dropped the minimal one, with a now-false comment.
Fix: lexicographic two-phase enumeration.
Phase 1 : opt.maximize(qualite) under cout < cout_precedent -> max quality.
Phase 2 : opt2.minimize(cout) at that fixed quality -> minimal cost, which
guarantees the point is truly Pareto-optimal (non-dominated).
Re-exec cells 1+10+12 (z3 4.16.0, rule F): 11 Pareto points, all on cout=2q
(the feasibility floor — for this model the minimal cost of quality q is exactly
2q, so the true front coincides with the floor). Real stdout transplanted to
cell 10; real matplotlib PNG transplanted to cell 12.
cell 11 markdown: removed the false "Pareto-equivalents" / "strictement au-dessus"
claim; the front now honestly coincides with the cout=2q floor, explained by the
two-phase method.
cell 13 markdown: rewrote the step table to reflect the two phases; added a key
point that phase 2 (minimize cost) is essential — without it the solver returns a
dominated cost.
Scope: cell 10 (code + output), cell 11 (md), cell 12 (output: plot + stdout),
cell 13 (md). 23 other cells byte-identical to origin/main. nbformat validate OK
(27 cells). C.1 clean, 0 leaks, CRLF=0, LF, no-BOM, trailing-nl. Surgical raw-json
round-trip (42+/44-, 1 file).
Visual note: cell 12 plot regenerated from verified-correct data (front points
are exactly (q, 2q); the plot draws those points + the cout=2q dashed line, so the
markers sit ON the dashed line by construction). GLM lane has no vision — visual
confirmation of the plot at merge-gate (ai-01/Opus has vision) welcome but the
data-level correctness is guaranteed.
Defect found via Explore sonnet scan (read-only, Z3-Python family — fresh rotation
out of SmartContract per R6), G.1 firsthand-verified: read the FULL cell 10 source
+ output and the cell 11/13 markdowns before editing; confirmed the dominated
points and the false Pareto-equivalence claim verbatim. Companion findings Z3-04
cell 20 (Star claim) + cell 13 (date label) are separate lighter grains.
See #3801.
Co-Authored-By: Claude-Code <noreply@anthropic.com>
Contributor
Golden-Set Execution (H.7 P3)✅ 8/8 notebooks passed (certified reproducible)
Pinned lockfile: |
Contributor
Notebook PR Validation: PASS
Checks: H.1 (no errors), H.3 (execution_count), C.1 (no banned patterns) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Grain: MED/code-correctness — lane myia-po-2025:CoursIA — prev: LIGHT/docs (#7908 SC-8)
Defect (class A code-correctness, G.1 firsthand-verified, scan finding #1)
Z3-Python-06-Advanced-Optimization.ipynbcell 10 — the notebook's centerpiece Pareto-front example — enumerated DOMINATED points and labeled them Pareto-optimal.enumerer_front_paretocalledopt.maximize(qualite)but never minimizedcout. Z3 then returned an arbitrary cost in[2*qualite, cout_precedent-1]. The committed output prints its own refutation — a "Cout min = 2*q" column showing 6 of 9 points hadCout > Cout min:Point 3 =
(qualite=8, cout=17)while(8,16)is feasible — same quality, strictly lower cost → (8,17) is dominated by (8,16). Yet cell 13 markdown claimed:Directly refuted by the cell's own output. Cell 11 compounded it with a false pedagogical defense: "à qualité fixée, plusieurs coûts sont Pareto-équivalents" — but
(8,16)dominates(8,17); they are NOT Pareto-equivalent.A second bug amplified it: the dedup "keep first point per quality" kept the arbitrary (high) cost and dropped the minimal one, with a now-false comment.
G.1 firsthand verification
Read the FULL cell 10 source AND its full committed output, plus the cell 11 + cell 13 markdowns, before editing. Confirmed the 6 dominated points and the false "Pareto-équivalents" claim verbatim. Also confirmed cells 4/7/17/22 (hierarchical, lexicographic, MaxSAT, budget) are correct → this is an isolated defect in the Pareto section.
Fix — lexicographic two-phase enumeration
Phase 2 guarantees the point is truly Pareto-optimal: without it, the solver returns an arbitrary (dominated) cost. This is the standard correct bi-objective enumeration (max-A-then-min-B).
Re-executed cells 1+10+12 with real z3 4.16.0 (rule F) → real outputs transplanted (Stop & Repair, no hand-edit):
cout=2q(every row carries the<-- cout minmarker — zero dominated points). For this model the minimal cost of qualityqis exactly2q(the constraintcout >= 2*qualite), so the true front coincides with the feasibility floor.front.Markdown honesty
cout=2qfloor, explained by the two-phase method guaranteeing every point is non-dominated.Validation
origin/main(surgical raw-json round-trip, 42+/44-, 1 file).NotImplementedError/assert False), 0 leaks, CRLF=0, LF, UTF-8 no-BOM, trailing newline.SOTA verdict
SOTA-OK — the cell now runs the correct Pareto-enumeration algorithm (lexicographic two-phase, the standard method) and Z3's real optimization is exercised at each step (11
Optimizesolves, each maximizing then minimizing). The displayed output is Z3's genuine output. The other optimization examples in the notebook (cells 4/7/17/22: hierarchical, lexicographic, MaxSAT, budget) were already correct and are untouched. No workaround.Visual note (transparent)
Cell 12's plot is regenerated from verified-correct data (front points are exactly
(q, 2q); the plot draws those points + thecout=2qdashed line, so the markers sit on the dashed line by construction). GLM lane has no vision capability — visual confirmation of the plot at merge-gate (ai-01/Opus has vision) is welcome, but data-level correctness is guaranteed by the verified enumeration.Method
Defect found via Explore sonnet scan (read-only, Z3-Python family — fresh rotation out of SmartContract per R6), G.1 firsthand-verified (read FULL cell source + output + markdowns). The scan's 2 other findings (Z3-04 cell 20 "Star" claim, Z3-04 cell 13 date label) are separate lighter grains.
See #3801.
Generated with Claude Code