diag: preserve factual source atomic-access diagnostics

This commit is contained in:
dev committed 2026-10-09 00:04:12 +03:00
1 parent ee09a7a290
commit edfef82cc6
18 files changed
+346 -9

No files matched your search

+2
View File
@@ -172,3 +172,5 @@ DD-022 grammar surface (cl100k): Quick Reference stays 8,948; other source docs
Q-051 source effect names (DD-023, cl100k): Quick Reference 8,948 → 8,955 (+7); other source docs 68,219 → 68,323 (+104), full source 77,167 → 77,278 (+0.14%). o200k groups are 8,991 / 68,526 / 77,517; Qwen2.5 9,233 / 69,994 / 79,227. The AIR copy in the source bundle grows 47,445 → 47,458 (+13); canonical AIR bundle bytes grow 184,628 → 184,678, through the shared E7002 registry description; library/std.md is unchanged. Unknown effects use existing E7002 with structured `name`/`effect`, replacing erroneous source E7900 or E0006. Accepted canonical AIR and authority/effect semantics are preserved. No new concept, syntax, code/reason, feature or verifier/runtime state is added; no empirical MCC benefit is claimed.
Q-052 CFG resource provenance (DD-024): Quick Reference and other/full source docs remain 8,955 / 68,323 / 77,278 cl100k (o200k 8,991 / 68,526 / 77,517; Qwen2.5 9,233 / 69,994 / 79,227); std is unchanged. Canonical AIR grows 184,678 → 185,220 bytes and 47,385 → 47,476 cl100k (+91), 47,540 → 47,631 o200k (+91), 48,917 → 49,009 Qwen2.5 (+92). The separately wrapped source-bundle AIR copy grows 47,458 → 47,549 cl100k. The added sentences clarify preservation of existing task/scope, guard and shield obligations through block arguments. No new agent concept, syntax, feature or diagnostic is introduced. Sparse implementation relations replace incomplete SSA metadata; verifier acceptance now enforces existing safety rules. No empirical MCC benefit is claimed.
P6-7 factual source E4202 fields (cl100k): Quick Reference stays 8,955; other source docs 68,323 → 68,353 (+30), full source 77,278 → 77,308 (+0.04%). o200k groups are 8,991 / 68,556 / 77,547; Qwen2.5 9,233 / 70,024 / 79,257. Only language/concurrency.md grows; AIR and library/std.md are unchanged. Concrete `found` and `use` fields distinguish ordinary atomic reads without message parsing. No new syntax, code, feature or verifier/runtime state is introduced; no empirical MCC benefit is claimed.
+4
View File
@@ -388,3 +388,7 @@ P6-7 rejection-twin work reproduced accepted source that returns the cancelled h
P6-7 requires every conformance rejection to have a source twin with the same code. Spec 15 §10 instead requires fully source-decided type errors to use E7xxx, and malformed generated AIR/SSA/CFG to report E7900 as compiler defects. Spec 15 §1/§9 also makes SSA, CFG, local placement, lexical borrow ends and feature headers generated mechanics. Examples: AIR lossy widening is E1002 but source is E7005; missing borrow-return `from` is E2102 in AIR but E7006 in source (§19); explicit branch arity, unsupported AIR versions and duplicate feature headers have no source operation. Uninitialized locals and deliberately invalid proven-index fact forms likewise have no implemented source spelling.
The exhaustive inventory in `tools/source_reject_twins.py` keeps these rows visible: same-code pairs, audited source-error analogues, AIR-only cases and pending audits. Only verified same-code pairs satisfy the current criterion; the other categories are not exclusions or completion evidence. The owner needs to decide how the final phase review should account for mandatory E7xxx translation and generated-only AIR defects, without weakening existing AIR tests, exposing raw mechanics in source, or changing diagnostics solely to satisfy coverage. Until then the original criterion and P6-7's doing status remain unchanged; unreviewed and authorable twins can still be completed.
2026-10-08 completed public audit: all 199 AIR rejection files are reviewed. The executable check verifies 91 same-code cases and 45 prescribed E7xxx source analogues; 63 cases have an audited source-boundary reason. No rows remain pending. Full conformance passes 1,713/1,713, but `--require-complete` still exits 1 because it requires every row to be same-code.
Proposed criterion, for owner decision: retain every AIR rejection test; for each source-authorable rule/context, require a compiled source twin with the same code or its spec-prescribed E7xxx translation, stable facts and independent positions. Generated-only contexts require an explicit governing source-policy audit. Every newly discovered public AIR rejection remains pending until audited. This proposal changes no language rule and does not count a matching code alone as a twin. It is not adopted; the literal gate and doing status remain unchanged.
+5 -3
View File
@@ -320,8 +320,10 @@ Validation: unit tests and Zig formatting pass; full conformance is 1,655/1,655.
## P6-7 public rejection-twin audit (2026-10-08)
Verified same-code coverage is 90/199 across ownership/resources, borrows, effects/capabilities, tasks, graphs, atomics, linear aggregates and buffer operations. The inventory retains 3 pending, 45 prescribed E7xxx analogues and 61 AIR-only cases; all three categories remain unmet under the literal exit criterion (Q-053). P6-7 remains doing.
Verified same-code coverage is 91/199 across ownership/resources, borrows, effects/capabilities, tasks, graphs, atomics, linear aggregates and buffer operations. The inventory retains 0 pending, 45 prescribed E7xxx analogues and 63 AIR-only cases; those 108 classified cases do not meet the literal same-code exit criterion (Q-053). P6-7 remains doing.
The [checker documentation](../../tests/conformance/README.md) records the diagnostic-fact, independent-position and context witnesses. Named type tables preserve the nominal diamond; early cycle pairs pin the two artifacts that exist before lowering. Five CFG loan pairs pin original AIR, source and canonical lowering after a manual shape review: single br handoff, lend/plain merge, loop-carried loans, cancelled-handle forwarding and parent access after handoff. Three cases remain pending: direct cbr/switch arm parameters are not preserved by the tested source merges, while ordinary atomic access produces E4202 before lowering, without AIR's structured found/use/operand facts. A code-only early match would weaken verification; it remains pending. The current early mode covers declarations only. The task-parameter feature pair validates each full repair header before comparing its missing closure; unrelated declared features do not decide that rule. Reserved channel endpoint elements retain their feature/construct at channel.make. The linear swap pair compares named enum tables and pins the array/unpack and specific arm where the old value leaks. Source-boundary analogues retain exact fields and independent markers; the nominal-call analogue records its local rather than linked declarations. The guard-unlock pair retains the returned view's mutex.borrow ancestor through the generated unlock. Fingerprints attest unchanged artifacts, not audit correctness, and introduce no provenance or lifetime analysis.
The [checker documentation](../../tests/conformance/README.md) records the diagnostic-fact, independent-position and context witnesses. Named type tables preserve the nominal diamond; early cycle pairs pin the two artifacts that exist before lowering. Five CFG loan pairs pin original AIR, source and canonical lowering after a manual shape review: single br handoff, lend/plain merge, loop-carried loans, cancelled-handle forwarding and parent access after handoff. The final direct cbr/switch arm-argument cases are AIR-only under spec 15 §4, supported by inspection of lowering and every branch argument in the 740 successful lowerings of the preceding 1,352 public source fixtures. Ordinary atomic access now has a full-AIR twin: a shared field read retains the same load/type/use facts; its reported operand must be the actual load operand. The task-parameter feature pair validates each full repair header before comparing its missing closure; unrelated declared features do not decide that rule. Reserved channel endpoint elements retain their feature/construct at channel.make. The linear swap pair compares named enum tables and pins the array/unpack and specific arm where the old value leaks. Source-boundary analogues retain exact fields and independent markers; the nominal-call analogue records its local rather than linked declarations. The guard-unlock pair retains the returned view's mutex.borrow ancestor through the generated unlock. Fingerprints attest unchanged artifacts, not audit correctness, and introduce no provenance or lifetime analysis.
Validation: full conformance is 1,707/1,707; unit tests, Zig formatting, all 58 checker regressions and the 90-pair source/AIR position check pass. All 65 source reject_twins fixtures pass collection before every instruction; source coverage remains 121/121. The completion gate still rejects partial coverage. Claude independently reviewed the feature/CFG witnesses and the remaining public rule boundaries, including the swap fingerprints and nominal family. New probes reject mutex creation substituted for channel creation, another swapped enum, a replacement call needing further identity review, omitted array/unpack and a leak on the other arm. The atomic bool analogue marks the source value operand; its AIR error instead marks the cell. Existing Git attributes already force LF for pinned AIR/source files. No compiler, verifier, runtime, normative rule, diagnostic code or reference bundle changes.
Validation: full conformance is 1,713/1,713; unit tests, Zig formatting, all 62 checker regressions and the 91-case source/AIR position check pass. All 66 source reject_twins fixtures and five atomic_access fixtures pass collection before every instruction; source coverage remains 121/121. The completion gate still rejects partial same-code coverage. Claude independently reviewed the feature/CFG witnesses, all remaining classifications and the atomic operand checks. New probes reject another scalar or borrow mode, an unrelated borrow reported as the operand, and inconsistent raw/source identities. Existing Git attributes force LF for pinned artifacts.
The frontend ordinary-dereference E4202 now adds concrete found and use fields, retaining the code, message, primary position and early failure. CLI tests pass 33 checks; comparison with the previous compiler passes 52, including generic/package provenance, first-error selection, untouched alternative errors and identical valid AIR. No SSA identity or AIR location is fabricated for a frontend rejection. Atomic access invariants, verifier/runtime rules and deterministic execution remain unchanged; valid reads use explicit atomic.load orderings. The schema is additive; the source bundle grows by 30 tokens (docs/agent/README.md). Q-053 remains the owner decision on the literal criterion; there are no unaudited public rows.
+1 -1
View File
@@ -502,7 +502,7 @@ The orderings:
Other rules:
- `*c` and any other ordinary read of a cell is `E4202`.
- `*c` and any other ordinary read of a cell is `E4202`. An ordinary source dereference MUST report `found` (the concrete borrow type) and `use: "atomic.load"`, including after generic substitution.
- Effects are declared by the programmer (spec 05 §13).
## 13. Built-in standard modules