Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dag/extdeps/languages/rust/emit.dag
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,10 @@ data rt_function_registry: List<RuntimeFunction> = [
{ name: "is_emoji_ident", bridge_name: "is_emoji_ident", passes_by_ref: false, wraps_result: false },

{ name: "symbol_lexeme", bridge_name: "symbol_lexeme", passes_by_ref: false, wraps_result: false },
{ name: "symbol_intern_lexeme", bridge_name: "symbol_intern_lexeme", passes_by_ref: false, wraps_result: false }
{ name: "symbol_intern_lexeme", bridge_name: "symbol_intern_lexeme", passes_by_ref: false, wraps_result: false },
{ name: "bytes_octets", bridge_name: "bytes_octets", passes_by_ref: false, wraps_result: false },
{ name: "utf8_encode_bytes", bridge_name: "utf8_encode_bytes", passes_by_ref: false, wraps_result: false },
{ name: "pure_dag_seam_unreachable", bridge_name: "pure_dag_seam_unreachable", passes_by_ref: false, wraps_result: false }
]

fn rt_functions() -> Map<String, Bool> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ data accepted_source_emits_uncompilable_target: RecurringFailureMode = Recurring
"EVIDENCE AND RUNG, stated at the grain it carries: the Rust integration target nullary_fn_value_emitted_rust (src/v1/stage0/tests) runs the probe through the interpreter, emits it, compiles the emitted module with rustc and runs it, and requires equal output -- RED on the pre-fix seed (rustc E0308), GREEN after. Required CI compiles but does not execute Rust integration targets (DESIGN, Building & checks), so the class stays at mitigatable on this path; the row's existing next-rung trigger (a required phase that emits a closure and compiles it over fixture-authored sources) is the one that would enrol this probe.",
"OCCURRENCE, 2026-09-24 (swift-bat-511): A NESTED-RECORD DATA ROW SPLICED AS RUST TOKENS. v1.compiler.emit_rust emit_data_def_body realized a data row whose type carries a record by serializing it with emit_data_value_json and handing the document to `serde_json::json!`, so rustc read every number as an integer LITERAL whose type defaults to i32 when nothing pins it. The first closure to hold such a row with an Int above 2^31 -- extdeps.crypto.sha2, whose SHA-256 initial hash words and SHA-512 round-constant halves are record rows -- was accepted at 0 blocking diagnostics and its emitted crate refused with 89 `literal out of range for i32`. THE CONTRACT THE LINK VIOLATED IS ITS OWN (DESIGN 6b): the value is a JSON document, and the macro reads its numbers under Rust's grammar instead of JSON's. So the repair is local and at that link: emit `serde_json::from_str` over the escaped document text, so serde_json parses the number into the declared field type. A per-literal i64 suffix was refused, because it puts a non-JSON spelling into emit_data_value_json, whose output is also consumed as real JSON (the mock-response path). Executing evidence: test.claim.data_row_wide_integer_literal_witness asserts the parsed-text route with a value above 2^31, with a narrow-literal control on the same route. Its red is the forbidden json! spelling. The build-and-read receipt is in the change that repaired it.",
"OCCURRENCE, 2026-09-25 (sleek-otter-453, approve-ios Swift target lane): THE KERNEL-BOOL / v2.std.logic.Bool CONFLATION, the Bool twin of gunbc.rung_drop text_boundary_identity_wall. `data swift_bool_grounding: BooleanAlgebra<Bool> = bool_boolean_algebra` in v2.extdeps.languages.swift was accepted at 0 blocking diagnostics, and its emitted crate refused with E0308 (`expected Rc<BooleanAlgebra<bool>>, found Rc<BooleanAlgebra<v2_std_logic::Bool>>`) the first time the module entered an emitted closure (v2.cli.compile_cli rostering the Swift target, CI run 36078559948). MECHANISM, read from the chain rather than the symptom: under #9813's contract an import never overrides a kernel name, so the bare `Bool` the module imports from v2.std.logic denotes the KERNEL Bool (host bool) at the annotation, while bool_boolean_algebra is over v2.std.logic's structural `Bool = True | False`; the checker admits the pair by leaf name and only rustc refuses. b21d3282cf's emitter guard covers the substituted-declaration (Disj) type argument only, and 285b02eed2 applied the source repair -- qualify the annotation as `v2.std.logic.Bool` -- to the python and typescript rows then in the self-host closure, leaving eight modules on the bare spelling (swift, go, kotlin, java, cpp, lean, ecmascript, rust_test_fixtures). THIS CHANGE qualifies those eight, which is the established repair and moves no rung. THE WALL IS NOT BUILT HERE: refusing the conflation at typecheck is the earlier boundary and touches #9813's contract. Its standing rustc-red is fixtures/fixture_closure_rustc/bool_carrier_data_row_probe.dag, which keeps the bare spelling on purpose and was measured red (two E0308) by `gunbc compile --entry` plus cargo on a 28 GB BuildBuddy executor. NEXT-RUNG TRIGGER, A CAPABILITY: the checker refuses a type argument whose kernel binding and whose value's declared carrier are different declarations of one spelling, SUFFICIENT FOR that fixture to be refused before emission rather than by rustc.",


"OCCURRENCE, 2026-09-24 (wise-hawk-615, routed from stern-raven-24's native App Attest row gunbc#12251, whose emitted crate refused at rustc with 45 errors in three emitter classes and one runtime-library gap). Each was worked to its earliest unjustified boundary (DESIGN section 6b) rather than at the call site. (C) STRING ORDERING: `a < b` over Timestamp, an alias of String (extdeps.standards.rfc_5280 x509_validity_at, gunbc.auth.approval_capability utc_instant_before). Timestamp comparison needed no new typed ordering: the interpreter already orders Strings byte-lexicographically, so the defect was the emitter's. The boundary was the operand classifier v1.compiler.emit_rust rust_operand_realization_of_type, which filed the corpus String as OperandIdentityUnavailable although the type renderer realizes it as the host text carrier by is_host_text_carrier_type; ordering then refused by operator class while `==` on the same operand passed. Repair: std.operator_realization HostRealizationReason gains HostTextCarrier and the classifier reads the renderer's own predicate, so both answer one question once; is_string_comparison admits the four ordering operators through the same host-string seam as equality, and an ordering over an OPTIONAL String refuses at emission (the interpreter has no Null-vs-Str ordering; Option's None-first order would be fabricated). (A) PRESENT BINDING: `match opt { null => a o => b }` bound the whole Option in emitted code (E0308, E0609) while v1.compiler.infer narrows `o` to the present value. ALL THREE match renderings now read the checker's optional_scrutinee_binding_is_present over match_unguarded_absent_arm_index and emit `Some(o)` in exactly that arm, never re-deriving the narrowing: emit_typed_match_arm_strs for ordinary matches, and emit_typed_tco_match_arm for matches inside the tail-call lowering, which the native App Attest run surfaced separately (extdeps.standards.rfc_5280 read_extensions_list, the one error left after the first renderer was repaired); and emit_typed_match's String-literal re-emission (needs_string_from), where a review of this PR found the decision dropped -- there a string-literal arm over an optional scrutinee also emits `Some(ref __s)`, since a literal matches only a present value. (D) OCTETS: std.bytes bytes_octets and utf8_encode_bytes were interpreter-intercepted builtins whose .dag bodies were placeholders -- `[pure_dag_seam_unreachable()]`, a one-element list of `1 / 0`, and `s as Bytes`, a cast no Rust row realizes and which emitted a runtime panic. Both are now declared HostRealizedSeams (self-call bodies, std.primitive_projection rows, std.primitive_identity declarations with SourcePreservingOrder traversal facts, extdeps.languages.rust.emit rt_function_registry rows, v1.runtime_rust bodies); bytes_octets is typed List<Int> under the bounded_natural_arithmetic_evaluated_as_unbounded_int ruling, since UInt8 has no emitted realization that holds an octet and bytes_qualified_octets is the one boundary observing the range. Two further links surfaced by execution: a REALIZED seam's self-call was lowered by the name-keyed tail-call rewrite into a non-terminating loop (rust_host_seam_is_realized now exempts it, see host_seam_self_call_diverges_when_its_arm_is_absent), and rustc's deny-by-default unconditional_panic refused every crate reaching std.bytes because of pure_dag_seam_unreachable's constant `1 / 0`. The first cut relaxed that lint for all generated code; review 71098 refused it as widening a real check to admit one placeholder, and the placeholder was the earlier link: pure_dag_seam_unreachable is now a rostered HostRealizedSeam too, refusing in the interpreter with a typed error naming the seam and panicking by name in v1_rt, so the lint stays on. EVIDENCE: the fixture test.fixture.emitted_interpreted_parity.string_order_octets_present_binding exits 0 interpreted and requires the thirteen-field line `T F T F T 6 2962370309 97 0 989 ex none q` -- fields 1-5 string ordering, 6-7 octets, 8-9 the ordinary-match present binding, 10 the tail-call-match present binding, 11-13 the String-literal re-emission -- with a RED control that exits 1 printing the observed line; its emitted crate builds and runs to the same line. The enrolled claim module test.claim.emitter_string_order_present_binding_witness_test carries the emission half: host-string ordering over an alias, the named refusal for an ordering over a String? (which inference admits today, so the arm is reachable), and the present binding in all three match renderings. The integration consumer is `gunbc test //gunbc/instruments:native-app-attest` on gunbc#12251. RUNG unchanged at mitigatable for the class: required CI still neither emits-and-compiles a fixture closure nor executes integration targets, which is this row's existing trigger.",
],


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ data host_seam_self_call_diverges_when_its_arm_is_absent: RecurringFailureMode =
"UNCERTAINTIES CARRIED, ONE OF THEM NOW DISCHARGED AND SAID SO HERE RATHER THAN LEFT STANDING BESIDE ITS ANSWER. This row used to carry, as its first uncertainty, that the specimen execution was a lane report and that no pre-#11121 binary had been run against it: the two-binary discrimination above did exactly that run, on a corpus head held fixed, so that uncertainty is closed and the mechanism no longer rests on a source reading alone. What remains uncertain is unchanged. The emitted-path claims are taken from `symbol_lexeme_seam_disposition_note`, the identity-form realization now in `v1_compiler.v1_rt`, and the resolver's stated suppression behaviour, not from an emission run performed for this row; that the two UNROSTERED self-call sites are absent from the emitted seed is a read of `src/v1` at f9d37e43a1, and whether an emission run that reached them would confirm a compiled self-call was not established by execution here. The denominator is a regex over first-expression self-application; a self-call reached through a `let` or a nested expression would be missed by the search and is not claimed absent.",
"ONE OF THE THIRTEEN IS GONE RATHER THAN CLIMBED, recorded by another lane (gunbc#11291) so the denominator above is not read as still current. `v2.std.node_reflection` resolve_type_node was one of the two self-call declarations this row names as having an interpreter arm and NO projection row -- the state it calls PROSPECTIVE exposure. It was not given a projection row and it did not climb: it was DELETED, together with its roster arm, its interpreter family arm, and the host functions beneath it (eval_resolve_type_node and the type_item_by_name scan), because a scope-carrying replacement left it with no consumer. So the count this row states is correct as OBSERVED on 2026-09-12 at f9d37e43a1 and is one lower afterwards, and the remaining member of that pair is `v2.std.data_index` data_init_decl_facts_live alone. The row is not re-swept here, because a lane that deletes one member is not thereby entitled to restate another lane's census.",

"THE ARM PRESENT IS NOT SUFFICIENT EITHER (wise-hawk-615, 2026-09-24). v1.compiler.emit_rust claimed a realized seam needs nothing special because resolution routes its self-call to the bridge. Measured on std.bytes bytes_octets once it was rostered with a registry row: call SITES did route to v1_rt::bytes_octets, but the DECLARATION was lowered by the tail-call rewrite, which keys recursion on the callee NAME, into `loop { __tco_loop_b = b; continue; }` -- it compiles and never returns, this row's invalid state reached with the arm present. rust_host_seam_is_realized, which asks the same registry as the unrealized arm, now exempts a realized seam from the tail-call and stack-growth lowerings, so its body emits as the routed call.",
],

evidence: [
Expand Down
9 changes: 9 additions & 0 deletions dag/gunbc/v1/v1_interpreter_primitive_surface.dag
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,15 @@ fn v1_interpreter_authored_roster_arms() -> List<InterpreterPrimitiveDispatchArm
dispatch_emit_site: EvalBuiltinInnerSite,
enumeration: AuthoredInRoster,
},
InterpreterPrimitiveDispatchArm {
arm: InterpreterPrimitiveArmId { identity: "free_call.pure_dag_seam_unreachable" },
form: FreeCall,
authored_spelling: "pure_dag_seam_unreachable",
realization_module: "v1_interpreter",
dispatch_symbol: "eval_builtin_inner",
dispatch_emit_site: EvalBuiltinInnerSite,
enumeration: AuthoredInRoster,
},
InterpreterPrimitiveDispatchArm {
arm: InterpreterPrimitiveArmId { identity: "free_call.discriminant" },
form: FreeCall,
Expand Down
36 changes: 33 additions & 3 deletions dag/std/bytes.dag
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@ import std.integer { QualifiedOctetsResult, uint8_octets_of_ints }
import std.disposition { Disposition, Scaffold, SingleAuthority }
import std.decl_ref { DeclarationRef, WholeDeclaration }

// THE DIVERGENT SEAM IS A DECLARED HOST SEAM, NOT A DIVISION. Its job is to be bottom: a value an
// arm the author proved unreachable can hold, which diverges if the proof was wrong. It was spelled
// `1 / 0`, and that spelling carried a meaning to each realization that it did not declare: the
// interpreter refused with DivisionByZero only if reached, while rustc's deny-by-default
// unconditional_panic lint refused every emitted crate whose closure contained the module, reached
// or not (native App Attest, gunbc#12251). Relaxing that lint for generated code would have removed
// a real check to admit one placeholder (review 71098 of gunbc#12261). As a rostered
// HostRealizedSeam each realization states the divergence itself: the interpreter's
// free_call.pure_dag_seam_unreachable arm refuses with a typed error naming the seam, and
// v1_rt::pure_dag_seam_unreachable panics with the same name -- an intentional divergence, which is
// what `!` is for, rather than a constant expression the target's own checker must reject.
fn pure_dag_seam_unreachable() -> Int {
1 / 0
pure_dag_seam_unreachable()
}

fn pure_dag_seam_unreachable_float() -> Float {
Expand Down Expand Up @@ -47,8 +58,21 @@ fn pure_dag_seam_unreachable_string() -> String {
if pure_dag_seam_unreachable() == 0 { "" } else { "" }
}

// A HOST SEAM, AND ITS BODY SAYS SO. The octets of a Bytes value are the host's (the interpreter's
// free_call.bytes_octets arm; on the Rust target v1_rt::bytes_octets over the Vec<u8> the carrier
// realizes as), rostered in std.primitive_projection as a HostRealizedSeam so resolution routes a
// call to the realization and never to this body. The body is the self-call that shape requires.
// It was `[pure_dag_seam_unreachable()]`, which is not a seam at all to an emitter: it emitted as
// ordinary code, a one-element list holding `1 / 0` -- a fabricated value in emitted code (DESIGN
// section 5), where the interpreter answered the real octets.
//
// THE RESULT IS List<Int>, NOT List<UInt8>, for the reason gunbc.recurring_failure_mode
// bounded_natural_arithmetic_evaluated_as_unbounded_int rules every such site: a value is typed as
// what it holds, and nothing in the corpus establishes this value's range -- bytes_qualified_octets
// below is the one boundary that observes it. The brand also had no emitted realization that
// could hold an octet (UInt8 renders as a phantom Compose), so the typed value was unemittable.
fn bytes_octets(b: Bytes) -> List<Int> {
[pure_dag_seam_unreachable()]
bytes_octets(b: b)
}

// THE ONE PLACE A HOST-PRODUCED BYTE LIST IS QUALIFIED, AND IT OBSERVES RATHER THAN ASSERTS.
Expand Down Expand Up @@ -104,8 +128,14 @@ fn octets_bytes(o: List<Int>) -> Bytes {
o as Bytes
}

// A HOST SEAM for the same reason bytes_octets is one, and rostered beside it: the interpreter's
// free_call.utf8_encode_bytes arm intercepts every call, so the former body `s as Bytes` was never
// what ran -- and on the Rust target no cast row realizes String -> Vec<u8> (a cast template is
// `{expr} as {type}`, which cannot spell an encoding), so it emitted as a runtime panic. The
// realization is the host's UTF-8 encoding (v1_rt::utf8_encode_bytes, String::into_bytes), the
// inverse of the utf8_decode_bytes realization already in that runtime.
fn utf8_encode_bytes(s: String) -> Bytes {
s as Bytes
utf8_encode_bytes(s: s)
}

data bytes_seam_host_realization_marker: Disposition = Scaffold {
Expand Down
11 changes: 11 additions & 0 deletions dag/std/operator_realization.dag
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,22 @@ type OperandRealization
// unnamed-operand population of the v2 closure under an arithmetic operator). Refusing there would
// refuse an operand nothing suggests is structural. What still refuses is the case the refusal is
// FOR: a type node that DOES name a declaration whose identity the caller could not resolve.
//
// THE HOST TEXT CARRIER is the type the target's type renderer realizes as its native string (on
// Rust, v1.compiler.emit_rust is_host_text_carrier_type: the String spelling whose declaration is not
// a structural FreeMonoid<Char>). The operator decision reads the SAME predicate the renderer reads,
// so an operand rendered as a host String is judged as one: its ordering is the host string's, which
// is the interpreter's (Value::Str, Value::Str) arm exactly -- byte-lexicographic over UTF-8. Before
// this arm the corpus String reached the ordering operators as an unreadable declaration and refused
// (extdeps.standards.rfc_5280 x509_validity_at, over the String alias Timestamp), while `==` on the
// same operand passed by operator class: one operand, two answers about whether it has a host
// realization.
type HostRealizationReason
= KernelMintedType
| GenericTypeParameter
| HostContainer
| UnnamedSynthesizedType
| HostTextCarrier

// AN OPERAND WITHOUT A READABLE DECLARATION decides BY OPERATOR CLASS, never by guessing a
// declaration. Equality and the connectives do not depend on the declaration at all: every
Expand Down
Loading