Repository navigation
tools: branch_solver -- z3 checks the stated infeasible outcomes (211 of 555 confirmed) (#4175) - #7577
Conversation
…4175) Checks stated infeasible branch outcomes (confirmed / witness / inconclusive, sound over-approximation of everything it does not model) and finds inputs that take an outcome, emitted in the strengthen.py / survivor_attack.py input format. z3 is the new `solver` extra. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The claim rests on how unlikely 100 FUNCTION RANDOM failures in a row are, not on a constant: branch_solver finds a path through the program alone (#4175). Owner ruling 2026-11-02: refile as R. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…uling) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No description provided. |
|
PR #7577 @ 215e3c4: 2 failed check(s) == Analyze (python) (failure) -- real == full-suite part 2/3 (failure) -- real |
|
No description provided. |
…, test_source_reads) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
CI shepherd: the head of this PR (f002861) is not the one a maintainer labelled |
…n (CodeQL) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rulings (made by Claude at the owner's request, 2026-11-03; the owner may override)1. z3 in CI: yes, pin it. Add 2.
Merge path: mark ready, re-approve the current head, merge. Then retarget #7578 → #7580 → #7581 → #7583 to |
|
No description provided. |
…ed assumption, not infeasible (#7577 rulings) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
CI shepherd: the head of this PR (92cc4cb) is not the one a maintainer labelled |
Pull request was converted to draft
|
No description provided. |
|
No description provided. |
|
No description provided. |
…7581, #7583, solver-more, #7584) (Part of #4175) (#7608) * tools: branch_solver -- z3 over the det reading of a COBOL program (#4175) Checks stated infeasible branch outcomes (confirmed / witness / inconclusive, sound over-approximation of everything it does not model) and finds inputs that take an outcome, emitted in the strengthen.py / survivor_attack.py input format. z3 is the new `solver` extra. Co-Authored-By: Claude Opus 5.5 <[email protected]> * infeasible outcomes: cbsa-bankdata 917:true is family R, not C (owner) The claim rests on how unlikely 100 FUNCTION RANDOM failures in a row are, not on a constant: branch_solver finds a path through the program alone (#4175). Owner ruling 2026-11-02: refile as R. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test_infeasible_outcomes: bankdata 917 is pinned as family R (owner ruling) Co-Authored-By: Claude Opus 5.5 <[email protected]> * survivor_attack facts + ladder-slice: use branch_solver (#4175) `facts` settles an `unreachable` verdict whose reason says a paragraph is never reached when branch_solver finds no input that enters it (attack result `solver-unreachable`, accepted by det_mutation.py state), and prints the reasons it questions without recording them. `packet` shows the solver's verdict on the paragraphs a reason names. ladder-slice asks the solver for inputs and checks infeasible entries before they are written. Co-Authored-By: Claude Opus 5.5 <[email protected]> * branch_solver: encode text one byte per character, nothing lossy (#3813, test_source_reads) Co-Authored-By: Claude Opus 5.5 <[email protected]> * branch_solver: drop unused locals and an implicit string concatenation (CodeQL) Co-Authored-By: Claude Opus 5.5 <[email protected]> * branch_solver: fault plans for RESP-driven arms; strengthen.py backend (#4175) Each EXEC CICS answers one response symbol (its RESP item and EIBRESP hold it, one of IBM's DFHRESP values). `reach --inputs` prefers responses a scenario's fault plan can give (equivalence_cics_faults.py's tables) and emits the `faults` entry: command, resource, nth 1, resp, resp2. `backend CASE PROMPT_FILE` answers strengthen.py's prompt, so `strengthen.py run --backend-command` closes gaps with the oracle and no model. Co-Authored-By: Claude Opus 5.5 <[email protected]> * branch_solver fields + survivor_attack: settle Field mutants of items no reachable statement uses (#4175) `branch_solver.py fields CASE` lists the WORKING-STORAGE items whose accessor no reachable statement runs; anything the runtime may touch outside a statement (LINKAGE, FILE, EIB, DFHAID, SQLCA, FILE STATUS, ODO objects, ADDRESS OF, DTO records, numeric-edited items set at creation, BMS maps a reachable SEND/RECEIVE names) counts as used. `facts` settles a mutant of such an item's Field declaration as `solver-unread`. Co-Authored-By: Claude Opus 5.5 <[email protected]> * field_observability: settle det-port Field-declaration mutants no input can see (#4175) Three facts, every doubt left to an attack: - dead window: X and the bytes of both windows are read by no reachable statement and no runtime reader (DTOs, LINKAGE, FILE, SQLCA, sent maps, EIBCALEN / EIBAID-under-HANDLE-AID / ADDRESS EIB); - map subfield: an unnamed BMS attribute / length whose bytes and the mutant's only hold X'00', spaces or typed lengths when SEND MAP reads them (a walk flag proves every SEND follows a clear; protected fields without FSET are never keyed, IBM 3270); - DFHAID: every key press satisfies the same EIBAID comparisons with the mutant as without. Plus offset-only relocation when nothing else touches either window. survivor_attack facts records `solver-unobservable` (det_mutation accepts it). The walk gains flow-sensitive Boolean flags (branch_solver Walk(flags=)). Co-Authored-By: Claude Opus 5.5 <[email protected]> * branch_solver reach: map input fields into `receive`; prefer the case's own values (#4175) A symbolic map's input field the condition reads (<map>I's <field>I) goes into the scenario's `receive`, and a witness first tries values the case's scenarios already use for the same field, so a data-dependent path (a READ that must find the record) has a chance. Oracle check: with the DELETE-NOTFND scenario of carddemo-userdel removed, strengthen.py with the solver as backend re-covered DELETE-USER-SEC-FILE:313:WHEN@323 (30/32 -> 31/32, proven). Co-Authored-By: Claude Opus 5.5 <[email protected]> * branch_solver: SQLCODE as a solver input; reach emits sql_faults (#4175) Each EXEC SQL's SQLCODE is one symbol (free for check); reach prefers 0, the codes the case's sql_faults already plan and the common ones, and emits {line, nth, sqlcode}. A LINKed program's input names no AID unless the case's scenarios do. Co-Authored-By: Claude Opus 5.5 <[email protected]> * branch_solver: STRING literal prefixes; one-way loop counters keep their start bound (#4175) STRING ... INTO x (no POINTER): the literal pieces it starts with (each cut at its delimiter) are x's first bytes, the rest any value. A numeric item that holds a known number at a PERFORM UNTIL head and that the loop (its ranges to their end, GO TO paths with fall-through) only increases (ADD / COMPUTE x = x + n) or only decreases stays >= / <= that number. The loop-body closure now stops a PERFORMed range at its end instead of falling through. Co-Authored-By: Claude Opus 5.5 <[email protected]> * field_observability: length-only mutants of items only moved into shorter items (#4175) An alphanumeric item or group the program only ever reads by MOVE X TO Y, each Y alphanumeric and no longer than the shorter window, hands Y the same leading bytes with either length (WS-CURDATE-MM-DD-YY 8 -> 9, moved into CURDATEO). Co-Authored-By: Claude Opus 5.5 <[email protected]> * branch_solver: caller-aware check (--callers); --github report for CI (#4175) estate_entry: what the estate's programs can send a program's COMMAREA (XCTL / LINK naming it, RETURN TRANSID of its transaction), region by region (offset, size, kind, scale), to a fixpoint over the estate: a sender's values come from its own value sets, which see ITS entry values through whole-area moves -- copy-in from LINKAGE, through unstructured buffers (INITIALIZE fills kept), reference modifications at a literal or LENGTH OF x + n. Every doubt is any value. `check --callers` reports `confirmed-callers` for a witness no input the estate sends reaches (assumption: its programs are the only callers). `check --github` writes the report to the job summary and warns on family C witnesses (solver-check.yml). Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci: solver-check -- branch_solver verdicts on a PR's stated infeasible outcomes (#4175) A PR that touches tests/equivalence/infeasible_outcomes/ gets branch_solver's verdict on every claim of the cases it touches in the job summary, and a warning on the file for a family C claim an input of the program reaches. Informational: never fails (the det sweep stays the gate). Not a required check; the path filter is the selector. Hash-pinned install set ci/requirements/solver.txt (z3-solver 4.15.4.0, tree-sitter-language-pack 1.22.1), generated with tests/tools/pin_ci_requirements.sh. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci: pin z3-solver in the treesitter lock; bankdata 917:true is a stated assumption, not infeasible (#7577 rulings) Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * solver-check: list it as a non-gate, trigger on the tools it runs, pair the corpora cache, retry the pip install The combined solver branch failed four CI-rule tests on its new workflow: gate_controls (every PR workflow is a gate or says why not), workflow inputs (a path-filtered workflow triggers on what it reads), cache keys (a corpora restore pairs with a guarded save) and ci_retry (a hash-pinned pip install goes through ci_retry.sh). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvf2aRvMjAx5eu3BDUj * solver-check: a case the PR deleted no longer aborts the bash -e step; list branch_solver.py as a cics spec importer (Part of #4175) Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * solver-check: list ready_for_review and carry the draft condition (test_workflow_draft_gate) Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * test_cics_spec: branch_solver imports DFHRESP (#4175) Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * test_cics_spec: drop the duplicate branch_solver entry Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --------- Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…; BANKDATA 917:true netted, back to L4 (#7700) * infeasible outcomes: family P (practically unreachable, owner ruling); BANKDATA 917:true netted, back to L4 Owner ruling 2026-11-04: BANKDATA's last branch outcome (GOD010 line 917, IF OPENED-DATE-ATTEMPTS > 100) needs 100 failed FUNCTION RANDOM opened-date draws in a row, probability under 15^-100. #7577's z3 check finds the input, so 92cc4cb removed it as infeasible and BANKDATA fell from L4 to L3 (47/48). The owner rules it netted anyway, as its own class: - family P "practically unreachable, by owner ruling" in infeasible_outcomes.py, open only to the cases in PRACTICAL_CASES (problems_in refuses it elsewhere); BANKDATA is the first and only member. - evidence_report / estate_evidence report it by name with counts ("practically unreachable"), never under "stated infeasible" and never as proven, like the U class; a proof that reaches it still refutes it. - mainframe-evidence-policy.md section 9 records the ruling and that it overrides #7577's 2026-11-03 ruling for BANKDATA only. The committed det-sweep ledger nets to 47/47 (100%) through the same path DELACC uses (13/13), so BANKDATA reads L4 at the next evidence refresh. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Regenerate docs_read_by_tests.txt for the family P rule edit Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…4 stance, Open World level build (Part of #7065) (#7699) * progress slide: external vs internal estates, L4 highlighted, below-L4 stance, Open World level build (Part of #7065) Owner request 2026-11-04: with the L1-L4 ladder finished, the "where we stand" slide now - highlights L4+ as its own hero tile (five tiles: L1, L2, L4, L5, CICS commands); - drops the per-level count table: one-line, larger legend, full-width bars, an "N / M at L4+" cell per row; - splits the ladder into external estates (burned, the headline totals) and internal estates (cics-crucible, the estate crucible), kept out of every total; - names every burned program below L4 with its ruling (source defect, refused by design, owner hold, or the report's next step), so a refusal reads as a stance, not a dropped program; - adds a card per Open World level (Batch Badlands, Alternate Index Archipelago, Warlords of the Message Seas, The Hierarchy Keep): built % = planned constructs whose horrors are all in the pinned baseline, horrors and passes at the pin, first-time run date once recorded. New tests/estate_crucible/levels.json holds each level's planned constructs (from #7065 and the level docs), mapped to merged horror ids only; a test refuses a half-pinned construct. ladder_exclusions gains short reasons and HELD_BELOW_L4 (BANKDATA: its last branch outcome is reachable per #7577's z3 check, owner skip 2026-10-30). Co-Authored-By: Claude Opus 5.5 <[email protected]> * ladder_exclusions: no BANKDATA hold (#7700 nets its last outcome by owner ruling); test uses a synthetic hold Co-Authored-By: Claude Opus 5.5 <[email protected]> * progress slide round 3: one story top to bottom, plain words, ladder in three matching bands (Part of #7065) Owner request 2026-11-04 after four reviews of the slide (a data-viz designer, a skeptical buyer, an evidence auditor, a story editor), merged where they agree and the owner's direction where they don't: - Order: header with the GnuCOBOL / not-z/OS caveat in plain words -> the six steps defined once -> four program tiles (L4 the hero) -> results ladder -> results by age of code -> planted bugs (L5) -> what the translator can do -> how faithful the runtime is -> work done. Section titles are computed claims ("Results: 125 of 129 ..."). - Ladder: one panel, three bands of the same geometry: real codebases (with the "not at every branch yet, each named" box right under them and a computed "net of N reviewed infeasible / undefined by IBM" line), our CICS test suite, and our Open World practice codebases as L0 bars ("being built: 12 of 20 planned constructs, 60% of our plan"; "first run pending"). Level horror counts are per level (27 of 27), not the crucible's 88 of 90. - Honesty: no "blind" for our own levels; "proved sort cases" -> "sort equivalence cases"; "none needed" -> "0 claimed"; a stale level (L4*) now counts at its level and is reported, not dropped; issue counts are labelled activity, not evidence; plain names for the milestones and the runtime rule families. - Colour: ladder hues mean a ladder level only; every other bar is one neutral ink; the runtime status palette no longer reuses ladder hues and its two warm statuses are no longer neighbours. - levels.json carries members_at_pin (COBOL programs / JCL jobs per level app at the pin); a test checks them against the pinned estate-crucible key when a clone is present. Co-Authored-By: Claude Opus 5.5 <[email protected]> * progress slide: results panel split in half, levels left and the L5 planted-bug bars right; L5 table gone Owner request 2026-11-04: the L1-L4 ladder no longer takes a whole panel. Each codebase row now carries two bars: left, L0-L4 (an L5 program counts at L4 there); right, its L5 work in its own single-hue ramp (pass, pass not yet counted, tested with planted bugs still open, not yet tested). The "N / M at L4+" sum column and the L5 table are gone; the L5 raw and sample shares and the hand-written ports' score are one line each under the bars. Our CICS test suite and the Open World levels show "L5 not yet started" the same way. L5's level swatch is the L5 bar's pass shade, so L5 is one colour everywhere. Segment labels print only where they fit. Co-Authored-By: Claude Opus 5.5 <[email protected]> * progress slide: headline tiles first with our test suite's numbers; L5 tile counts planted bugs caught Owner request 2026-11-04: the four headline boxes come first, the level legend under them. Each box now carries the real-codebase figure and, under a rule, our CICS test suite's (85 / 85, or "L5 not yet started"). The L5 box leads with the planted bugs our tests caught (12,350 of 18,585 run, 66%) and says how many programs pass L5, rather than "11 / 129". Under the bars, the L5 note gives the full accounting: caught, explained as harmless (equivalent / unreachable, labelled reviewed claims not yet audited, per the 2026-11-01 L5 audit), and the share of the 42,693 possible planted bugs run. Explained survivors are not added to the caught count. Co-Authored-By: Claude Opus 5.5 <[email protected]> * progress slide: one internal-test-suites band; JCL step flow row computed; level plan at v0.7.0 - Bands 2 and 3 are one band, "Our internal test suites": the CICS test programs and the Open World practice codebases, never in a total (owner 2026-11-04). - Capability ledger: a computed "JCL step flow" row. The jcl_flow evaluator is run live on the 14 IBM-written FLOW fixture scenarios (the bar) and on CardDemo's 34 answers over its 8 EXEC COND jobs (34 of 34). Without the corpus (the docs run) it reads tests/equivalence/jcl/carddemo/measured.json, recorded by `capability_ledger.py jcl-measure CORPORA`, only while its answers hash matches; a corpus-gated test keeps the record equal to a live run. The old row is "JCL job execution" (steps still wired by the case). - levels.json follows the v0.7.0 pin (#7702): the horrors of slices 4-5 and Hierarchy Keep slice 1 (H-0083..85, H-0094..98) and the v0.7.0 member counts. Co-Authored-By: Claude Opus 5.5 <[email protected]> * capability ledger: "Code pages and national text" group (EBCDIC pages, cultural dialects, multicultural estate) Owner 2026-11-04: the slide hid the World Tour work. Three computed rows: - EBCDIC code pages: the pages the scanner decodes (ebcdic_codecs / ebcdic_dbcs: 15 single-byte national, 5 double-byte) and how many the generated Java decodes too (a JDK charset name): 20 / 20. - Cultural dialects: the Cultural Gauntlet's source dialects x data code pages, and its known-failing cells read from the CI ratchet (tests/cultural_gauntlet/baseline.txt): 10 dialects in 7 pages, 0 failing. - Multicultural test estate: the estate crucible's phase-2 horrors (H-0035..H-0049) passing at the pin: 15 / 15. Co-Authored-By: Claude Opus 5.5 <[email protected]> * status slide: estate sizes and JCL coverage, recorded from the pinned corpora (Part of #7065) (#7707) Owner 2026-11-04 (follow-up to #7699): show how big the real codebases are and how much of their JCL the step-flow reader covers. - tests/tools/estate_size.py measures, per burned estate: the ladder's programs and their lines, the copybooks they COPY / EXEC SQL INCLUDE and those members' lines, JCL members, jobs job_flow reads with a step, jobs whose flow depends on COND / IF, and jobs with IBM-based run / bypass answers. The docs run has no corpus, so the numbers are recorded in tests/fixtures/estate_size.json (`estate_size.py CORPORA --write`); test_estate_size.py re-counts and compares wherever the corpora are present, and checks the counters on small inputs. - The slide's real-codebase rows carry a size line (e.g. "30k lines · 72 copybooks · 55 jobs"; all six: 76k lines, 116 copybooks, 143 jobs). The capability ledger gains "JCL in the real codebases": 143 jobs read in 213 JCL members, 18 depend on COND / IF, 8 of them answer-checked (CardDemo). Stacked on #7699. Co-authored-by: Claude Opus 5.5 <[email protected]> * change_classifier: regenerate docs_read_by_tests.txt for the slide and estate_size changes Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Closes #4175.
What
tests/tools/branch_solver.py: z3 over the det translator's own reading of a COBOL program (det/stmt.py,det/expr.py,det/layout.py). It records, for each IF and EVALUATE outcome, the condition under which the program reaches and takes that outcome, and asks z3 about it.It gives three answers only:
confirmed: unsatisfiable, and the walk was complete.witness: an input reaches the outcome, with the values z3 chose.inconclusive: a timeout, or a construct the walk does not follow.It commits nothing. z3 is the new
solverextra. The testsimportorskipit, like the other box-only tools.Soundness (why
confirmedcan be trusted as far as the model goes)Everything the walk does not model is over-approximated, so imprecision can only turn a
confirmedinto awitnessorinconclusive:index >= FROMwhen the body never writes the index. A paragraph re-entered by GO TO, or a range PERFORMed again while it runs (HANDLE labels), is walked once more from the all-fresh state.confirmedasinconclusive.witness.Result: every stated infeasible outcome (main @ 97bed71, 99 cases, 555 claims)
9000-READ-ACCTclaims on WS-RETURN-MSG 88s).PERFORM UNTILare not modelled (the POPULATE-* paragraphs).cbsa-bankdata917:true: the claim rests on the probability of 100 FUNCTION RANDOM failures in a row. That is a stated assumption, not a constant, so family R (or an assumption entry) fits it better than C. The owner decides.zecs-zecs002, whose EVALUATEs are lowered HLASM that the coverage naming cannot pair. The other 7 are ALTER / ENTRY / NEXT SENTENCE, or outcome names the walk's reading does not have.cbsa-bnk1dcsat 180 s, and most cases take under 5 s.Mutant work (item 1 of the ask)
case_gapsurvivors are stale. The 353case_gapsurvivors on the E ladder come fromdocs/language_status/mutation_scores.json, i.e. stale model-port runs. LGSTSQ'sQ=gap, for example, already has a scenario.case-gapat all. Of their 5,178 survivors, 874 touch program fields, and every one of those is a CON mutant on a field's layout constant. None is a translated branch condition: the existing scenarios kill those already. The top 25 ofsurvivor_attack.py nextare all COMMAREA-length plumbing.paragraphschecks reachability claims behind survivor verdicts. It confirms "POPULATE-TIME-DATE is never PERFORMed" for acctctrl, updacc and updcust (22 survivors).reach --inputswrites inputsstrengthen.py/survivor_attack.py tryaccept, with printable text preferred. For example,carddemo-userdel 199:false→ PF3 with a non-blank CDEMO-FROM-PROGRAM.Walk bugs found while sweeping (all fixed, each with a test)
PERFORM SECTIONran only the section's header paragraph, because det keeps the header as a paragraph of the same name.OTHER(coverage names itnone).Rulings applied (2026-11-03)
cbsa-bankdata917:true is no longer an infeasible entry (neither C nor R: an input reaches it, improbably; the RANDOM seed comes from the PARM, so no constant-seed family C). The ledger file is deleted; the outcome stays an uncovered branch (47/48), a stated assumption of the proof, never netted.pr_gates --fast: 9/9.Class / Sibling gaps
Class: stated infeasible outcomes in
tests/equivalence/infeasible_outcomes/checked by the solver (555 claims across families C, G, R, U, table above); every claim gets one of confirmed / witness / inconclusive, so all members are handled by the same mechanism. Sibling gaps: (1) "stated assumption" has no reporting class of its own yet: only family U is named inevidence_report.py/estate_evidence.py, so the bankdata 917:true assumption is recorded in its test, not in the evidence report (needs a new family across three files, beyond the 5-file limit; owner call); (2) theNextitems below (STRING results, PERFORM UNTIL counters,survivor_attack.py factswiring) are separate mechanisms.Checks
tests/tools/test_branch_solver.py: 19 tests on small programs, one per rule. All pass with z3 installed; the file is skipped without it. Per the 2026-11-03 rulings,z3-solver==5.3.3.0is now pinned (hash-locked) inci/requirements/treesitter.in/.txt, which the full-suite job installs, so CI runs it. Not run locally with z3 in this round (the selfscan venv has none).audit_check.py: all clear (ruff, format, mypy, dead-key).mypyon the file itself: clean.Files: 3 in the first round; this round adds
tests/tools/test_infeasible_outcomes.pyplus the regeneratedci/requirements/treesitter.{in,txt}and the deletedcbsa-bankdata.jsonledger file.Next
PERFORM UNTILcounter bounds. That would turn most of the remaining C witnesses into confirmations.paragraphs/checkintosurvivor_attack.py facts(a separate PR).🤖 Generated with Claude Code