omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / seed / qualification / om2 / sec / s0s2
725ca83 OM-2: #748 independent qualification harness, fixtures and C2 manifest (L836) (#752)
| .. | |
| exp/ | |
| lib/ | |
| s0/ | |
| s1/ | |
| s2bnd/ | |
| s2fmt/ | |
| s2hex/ | |
| README.txt | 9225 |
| c2-extra.txt | 5558 |
| candidate.cases | 32393 |
| pinned.cases | 16938 |
SPDX-License-Identifier: Apache-2.0 L836 Phase B, lane FixLex: independent fixtures for omegese-om2.md sections 0, 1, 2 (contract sha256 245bb74e..0881; errata E1, E2, E4, E6 on aien-dev om2/contract fd9e05a2). Written from the contract, the errata, OMEGESE.md and baseline main acb3f15 only. FILES lib/putu.om OM-1 decimal printer appended after a fixture (SRC a+b) s0/ opt-in line, OM-1 name preservation, OM-1 refusals of OM-2 words, CR LF in OM-1, q1-*: OM-2 reserved words declared as names (E6 Q1) s1/ om2 diag units (refusals), plain om2 twins s2hex/ hex literals: OM-2 programs, refusals, same pairs, OM-1 decimal twins s2bnd/ expression boundaries and grouping, om1-* and om2-* twins s2fmt/ hdr.txt ("om2 fmt\n"); formatter inputs x1..x5 (x5 is an OM-1 rest); malformed inputs bad-*; notes-before.om and om2-then-fmt.om (E6 f) exp/ expected stdout/stderr, generated by oracle/s0s2/oracle.py (never by a compiler) candidate.cases for an OM-2 candidate (each case has its contract/errata citation on the # line above it) pinned.cases for the pinned OM-1 compiler 734f0a39 now c2-extra.txt OM-1 units with the sha256 of their pinned output (C2), refusals as comments Evidence: evidence/phaseB/s0s2-pinned.log (OM2GATE PASS cases=144) and evidence/phaseB/s0s2-candidate-under-pinned.log (candidate.cases under the OM-1 compiler, invalid=0: the OM-1 cases pass, the OM-2 cases fail; a negative control, not a candidate result). DECIDED BY ERRATA (formerly open questions) E4 col = 1-based byte column of A on A's line; span = offending lexer token, len-len at end of input; found = hex of the span bytes or '-'; fmt "rest" = bytes after the first LF, output without the om2 fmt line. E6 Q1 reserved word declared as a name in an OM-2 unit: error 16 (s0/q1-*: fn rotr, fn layout, parameter part, variables fresh and at). E6 Q2 expect=number for error 6/8 literals; expect=end, sev=incomplete for a missing end at EOF; expect=name for an unknown name; LF span, sev=error for a line ending early with more input; callee-name span, sev=unknown for an incomplete call to an unread function. All these s1 cases are now exact (file:) except d-mid-short (below). E6 Q3 fmt refusal lines count every input line, om2 fmt included: bad-* cases are exact err:. E6 Q4 a: trailing blank lines are error 6 (bad-trailblank). b: whitespace-only line becomes empty (x3). c,d: any line whose first token is note is kept byte for byte, indented or with trailing blanks (x1, x3). e: whitespace next to ( or ) is kept as written (x3, x4). f: om2 fmt only at byte 0; elsewhere error 16 at its line (bad-fmtlater, notes-before, om2-then-fmt). g: CR is error 6 anywhere, including in text (bad-cr, bad-cr1, bad-crtext). h: the rest may be OM-1 (x5; its same case runs under the pinned compiler now). Correction: s2-fmt-bad-crtext expected line 3, but with the om2 fmt line and the fixture's note line the CR is on line 4 (err:4:6); the S1 run exposed the miscount and the coordinator confirmed it. ASSUMPTIONS (where contract and errata are silent; each also stated next to its case) A1 0 line 13 + erratum E10: blank lines (empty or only spaces) are skipped like notes when finding the om2 line, so s0-blank-first and s0-blank-spaces-first are OM-2 units (they run, exit 0); OM-1 still refuses them at the om2 line (pinned: error 16 at line 5). Lines with trailing text (om2 , om2 foo, om2 diag x, om2 diag, " om2", OM2) are not the opt-in line: OM-1 units keeping the OM-1 result. A2 OM-1 codes for OM-2-only constructs in OM-1 units (s0/w-*) are what the pinned compiler gives today; C1 (line 17) requires the candidate to keep them (line 14: recognised only in OM-2 units). A3 s0-optin-diag-same: an om2 diag unit compiles to the same artifact as the same om2 unit (lines 34-37 and 116: diag adds stderr records, stdout unchanged). A4 OM-2 units keep OM-1 error codes for non-OM-2 failures (preamble line 5: additive; 2 line 59 "both profiles, unchanged"). [ and { stay error 3 in OM-2 (line 62). Undeclared struct stays error 16, undeclared function error 3. A5 Formatter tokens: TAB is whitespace (the OM-1 lexer accepts it); indentation is the leading run of spaces/tabs; a text literal is one token from " to the closing unescaped ". "Whitespace next to ( or )" (E6 e) = a whitespace run whose left token ends in ( or ) or whose right token starts with ( or ); every such run is kept, every other inner run becomes one space, trailing runs are dropped (x3 `ret (add y x)` -> `ret (add y x)`; x4 `z = ( add y x )` -> `z = ( add y x )`). A6 Hex: the human line names the literal's line. 17+ digits is error 6 whether or not the value fits (r6-17small value 1, r6-17big 2^64): line 56 counts digits before the range rule applies. A7 found for a token longer than 32 bytes holds its first 32 bytes (d-longtok; line 40 "at most 32"). A8 The record's line= equals the human line N (all exact s1 cases). For an EOF span after a final LF the line is the empty last line, col 1 (d-eof-noend), which is also OM-1's human line. A9 An fmt CR error names the line holding the first CR (bad-cr: the note line of the rest, line 2). REMAINING NOT FIXED (2 notrun in candidate.cases) R1 d-mid-short: E6 Q2 puts the span on the LF that ends `ret add x`, but OM-1's human line is the next line (`end`). Whether the record's line= is the LF's line or the human N, and its expect=, are not stated. tok: case checks human line, code, sev=error, col=10 (A's column on A's line), span, found=0a, obligation, profile; s1-d-mid-short-line notrun. R2 bad-trailblank: E6 (a) gives error 6 but not which line (first or last blank line) the human line names: refuse + empty-stdout cases; s2-fmt-bad-trailblank-line notrun. OBSERVATIONS ON THE PINNED COMPILER (all re-checked by pinned.cases) O1 0 line 14 "OM-1 refuses that line": true only when nothing earlier in OM-1's pass order fails. OMEGESE 9.2's names pass reads every fn signature before any body or top-level line, so an OM-2 unit whose signature is not OM-1-clean is refused at the FIRST such fn line (error 16 for fresh / view T * / out / unknown type; error 5 for a trailing `inline`), not at the om2 line. Rule applied to every pinned expectation: refused at the om2 line iff all signatures are OM-1-clean. All s0 opt-in and q1 fixtures and every other OM-2 fixture in this lane are signature-clean except s1/d-unknown-sparam.om (opt-in at line 3, undeclared struct Pt in the line-4 signature), whose pinned case expects line 4, error 16. O2 `ret add 1 2 3` is error 11 (ambiguous bare-number add, found before the extra token), not a tokens-left code. With a typed operand (`ret add x 2 3`) tokens left is error 5. Both are pinned. O3 A line ending before an operand is complete is error 4 reported on the NEXT line when more input follows (`ret add x` then `end`: the end line), and on the same line at end of input without LF. O4 OM-1 accepts CR (CR LF and a lone CR before LF) as whitespace; s0-om1-crlf pins it under C1. The CR refusal (2 line 66, E6 g) is formatter-only. O5 Grouped and ungrouped forms (g0..g4) compile to byte-identical output under 734f0a39, and so do x1..x5 against their oracle fmt output when the om2 line is removed (dev check; only x5, an OM-1 unit, is a delivered pinned case). MUTANT KILL SPECS (candidate.cases, run under the mutant candidate compiler) (a) accepts uppercase hex digits / 0X: s2-r6-upper, s2-r6-mixed, s2-r6-upperX, s2-r6-upper-ulong, s1-d-hexupper-plain and s2-fmt-bad-hex FAIL "compile exit=0 expected=6" (artifact on stdout); s1-d-hexupper FAIL likewise. accepts 17 digits: s2-r6-17small FAIL "compile exit=0 expected=6"; s2-r6-17big FAIL "compile exit=8 expected=6" if the mutant then applies the range rule, exit 0 if it wraps; s1-d-longtok FAIL (exit 0 or 8, expected 6). (b) fmt rewrites a note line (collapses its spaces/tabs, strips its indentation or trailing blanks): s2-fmt-x1 (lines 2-3: triple/double spaces, TAB) and s2-fmt-x3 (line 2 trailing spaces, line 3 indented note with a trailing TAB) FAIL "stdout differs at byte". fmt rewrites text-literal bytes (collapses the "a b" / "q q" spaces, the all-space " ", or decodes an escape): s2-fmt-x1 and s2-fmt-x5 ("ok \n") FAIL "stdout differs"; if the compiled bytes change too, s2-fmt-x1-same / s2-fmt-x5-same and the x1fmt / x5fmt runs FAIL as well. (c) diag with a wrong span (off by one, whole line, start of line, a different token): every exact s1 case (d-left, d-eof-left, d-eof-mid, d-eof-noend, d-hexupper, d-hexrange, d-longtok, d-unknown-fn, d-unknown-struct, d-unknown-sparam, d-unknown-args) FAIL "stderr differs at byte"; d-mid-short FAIL on its tok line (span=214-215, col=10, found=0a). A wrong sev (incomplete for every EOF failure) fails s1-d-eof-left; error at EOF fails s1-d-eof-mid and s1-d-eof-noend; error instead of unknown fails the s1-d-unknown-* cases.