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
19 changes: 0 additions & 19 deletions src/v1/compiler_tests_rust.dag
Original file line number Diff line number Diff line change
Expand Up @@ -2020,24 +2020,6 @@ fn ct_contracts_sidecar_witness_test() -> String {
" }\n\n")
}

fn ct_caret_parse_smoke_native_witness_tests() -> String {
concat(
" #[test]\n",
" fn caret_parse_smoke_native_compile_emit_witnesses() {\n",
" use crate::v1_tests_claim_caret_parse_smoke_test::*;\n",
" assert!(w_caret_tokenizes_as_sh_caret());\n",
" assert!(w_caret_paren_tokenizes_as_caret_then_lparen());\n",
" assert!(w_parse_caret_ident_produces_literal());\n",
" assert!(w_parse_caret_paren_produces_discriminant_call());\n",
" assert!(w_parse_expr_caret_paren_full_pipeline());\n",
" assert!(w_parse_expr_caret_var_arg_produces_discriminant_call());\n",
" assert!(w_parse_module_let_caret_paren());\n",
" assert!(w_compile_to_resolved_caret_probe5b_has_no_caret_function_error());\n",
" assert!(w_emit_caret_ident_symbol_literal());\n",
" assert!(w_emit_caret_paren_discriminant_sugar());\n",
" }\n\n")
}

fn ct_call_shape_wall_witness_test() -> String {
concat(
" #[test]\n",
Expand Down Expand Up @@ -2802,7 +2784,6 @@ fn compiler_tests_source() -> String {
ct_constructor_call_admission_qualified_caller_test(),
ct_sole_constructor_fieldless_witness_test(),
ct_contracts_sidecar_witness_test(),
ct_caret_parse_smoke_native_witness_tests(),
ct_self_parse_all_test(),
ct_self_resolve_test(),
ct_self_compile_test(),
Expand Down
15 changes: 0 additions & 15 deletions src/v1/stage0/src/compiler_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1610,21 +1610,6 @@ mod compiler_tests {
result.expect("contracts_sidecar_wired_into_emit_scope panicked");
}

#[test]
fn caret_parse_smoke_native_compile_emit_witnesses() {
use crate::v1_tests_claim_caret_parse_smoke_test::*;
assert!(w_caret_tokenizes_as_sh_caret());
assert!(w_caret_paren_tokenizes_as_caret_then_lparen());
assert!(w_parse_caret_ident_produces_literal());
assert!(w_parse_caret_paren_produces_discriminant_call());
assert!(w_parse_expr_caret_paren_full_pipeline());
assert!(w_parse_expr_caret_var_arg_produces_discriminant_call());
assert!(w_parse_module_let_caret_paren());
assert!(w_compile_to_resolved_caret_probe5b_has_no_caret_function_error());
assert!(w_emit_caret_ident_symbol_literal());
assert!(w_emit_caret_paren_discriminant_sugar());
}

#[test]
fn self_parse_all_modules() {
let result = std::thread::Builder::new()
Expand Down
6 changes: 1 addition & 5 deletions src/v1/stage0/src/v1_compiler_compiler_tests_rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,6 @@ pub fn ct_contracts_sidecar_witness_test() -> String {
v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(" #[test]\n".to_string(), " fn contracts_sidecar_wired_into_emit_scope() {\n".to_string()), " // Discriminating witness: AnthropicChatMessage is declared in\n".to_string()), " // extdeps.llm.anthropic; its tag = \"role\" wire_contract lives in the\n".to_string()), " // anthropic_contracts.dag sidecar. This proves contracts_items_for_module\n".to_string()), " // and the wire_contract alias-resolution scope merge the sidecar into the\n".to_string()), " // emitted module -- red if the sidecar wiring or alias scope regresses.\n".to_string()), " let result = std::thread::Builder::new()\n".to_string()), " .stack_size(64 * 1024 * 1024)\n".to_string()), " .spawn(|| {\n".to_string()), " let entry_pairs = discover_dag_files(\"dag/extdeps/llm\");\n".to_string()), " let sources = std::rc::Rc::new(resolve_source_closure(entry_pairs, &[\"dag\"]).into());\n".to_string()), " let result = crate::v1_compiler_compile::compile_sources(\n".to_string()), " sources,\n".to_string()), " crate::v1_compiler_artifact::RenderTarget::Rust,\n".to_string()), " );\n".to_string()), " let anthropic_file = result.files.iter()\n".to_string()), " .find(|f| f.path.ends_with(\"extdeps_llm_anthropic.rs\"))\n".to_string()), " .expect(\"emitted file for extdeps.llm.anthropic not found in source closure\");\n".to_string()), " assert!(\n".to_string()), " anthropic_file.content.contains(\"#[serde(tag = \\\"role\\\"\"),\n".to_string()), " \"AnthropicChatMessage serde tag = role must be present in emitted Rust (contracts_items_for_module merged into emit scope); missing from: {}\",\n".to_string()), " anthropic_file.path\n".to_string()), " );\n".to_string()), " })\n".to_string()), " .expect(\"failed to spawn thread\")\n".to_string()), " .join();\n".to_string()), " result.expect(\"contracts_sidecar_wired_into_emit_scope panicked\");\n".to_string()), " }\n\n".to_string())
}

pub fn ct_caret_parse_smoke_native_witness_tests() -> String {
v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(" #[test]\n".to_string(), " fn caret_parse_smoke_native_compile_emit_witnesses() {\n".to_string()), " use crate::v1_tests_claim_caret_parse_smoke_test::*;\n".to_string()), " assert!(w_caret_tokenizes_as_sh_caret());\n".to_string()), " assert!(w_caret_paren_tokenizes_as_caret_then_lparen());\n".to_string()), " assert!(w_parse_caret_ident_produces_literal());\n".to_string()), " assert!(w_parse_caret_paren_produces_discriminant_call());\n".to_string()), " assert!(w_parse_expr_caret_paren_full_pipeline());\n".to_string()), " assert!(w_parse_expr_caret_var_arg_produces_discriminant_call());\n".to_string()), " assert!(w_parse_module_let_caret_paren());\n".to_string()), " assert!(w_compile_to_resolved_caret_probe5b_has_no_caret_function_error());\n".to_string()), " assert!(w_emit_caret_ident_symbol_literal());\n".to_string()), " assert!(w_emit_caret_paren_discriminant_sugar());\n".to_string()), " }\n\n".to_string())
}

pub fn ct_call_shape_wall_witness_test() -> String {
v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(" #[test]\n".to_string(), " fn call_shape_wall_witness() {\n".to_string()), " // DISCRIMINATING RED for direct_call_shape_wall_note (04_infer). Before the\n".to_string()), " // wall, `sub(a: 10, bb: 3)` against `fn sub(a: Int, b: Int)` compiled with\n".to_string()), " // ZERO diagnostics: the per-param type walk absorbed the mislabeled arg into\n".to_string()), " // its position, the interpreter refused the same call at runtime\n".to_string()), " // (CallContractMismatch in call_function_inner), and the Rust emitter\n".to_string()), " // silently REORDERED it positionally — two realizations of one program\n".to_string()), " // disagreeing silently. The wall makes the compile seam agree with the\n".to_string()), " // runtime authority, on both of the classes the runtime refuses.\n".to_string()), " let result = std::thread::Builder::new()\n".to_string()), " .stack_size(8 * 1024 * 1024)\n".to_string()), " .spawn(|| {\n".to_string()), " let compile_one = |path: &str, content: &str| {\n".to_string()), " crate::v1_compiler_compile::compile_sources(\n".to_string()), " std::rc::Rc::new(im::vector![std::rc::Rc::new(\n".to_string()), " crate::v1_compiler_compile::SourceFile {\n".to_string()), " path: path.to_string(),\n".to_string()), " content: content.to_string(),\n".to_string()), " }\n".to_string()), " )]),\n".to_string()), " crate::v1_compiler_artifact::RenderTarget::Rust,\n".to_string()), " )\n".to_string()), " };\n".to_string()), " let mislabeled = compile_one(\n".to_string()), " \"mislabel.dag\",\n".to_string()), " \"module mislabel\\nfn sub(a: Int, b: Int) -> Int { a - b }\\nfn f() -> Int { sub(a: 10, bb: 3) }\\n\",\n".to_string()), " );\n".to_string()), " let unknown: Vec<_> = mislabeled.diagnostics.iter()\n".to_string()), " .filter(|d| matches!(*d.diagnostic, crate::v1_std_core::CompilerDiagnostic::CallArgumentNameUnknown { .. }))\n".to_string()), " .collect();\n".to_string()), " assert!(\n".to_string()), " !unknown.is_empty(),\n".to_string()), " \"an argument labeling a parameter that does not exist must refuse at the compile seam — the interpreter already refuses this call at runtime, and the emitter silently reorders it, got: {:?}\",\n".to_string()), " mislabeled.diagnostics\n".to_string()), " );\n".to_string()), " assert!(\n".to_string()), " unknown.iter().all(|d| crate::v1_std_core::is_error_diagnostic(d.diagnostic.clone())\n".to_string()), " && crate::v1_std_core::is_interpreter_blocking_diagnostic(d.diagnostic.clone())),\n".to_string()), " \"CallArgumentNameUnknown must BLOCK — a counted advisory would still emit the silently-reordered realization\"\n".to_string()), " );\n".to_string()), " let surplus = compile_one(\n".to_string()), " \"surplus.dag\",\n".to_string()), " \"module surplus\\nfn two(a: Int, b: Int) -> Int { a + b }\\nfn f() -> Int { two(1, 2, 3) }\\n\",\n".to_string()), " );\n".to_string()), " assert!(\n".to_string()), " surplus.diagnostics.iter().any(|d| matches!(*d.diagnostic, crate::v1_std_core::CompilerDiagnostic::CallPositionalSurplus { .. })),\n".to_string()), " \"a positional argument beyond the declared positional parameters must refuse — the interpreter refuses the same call (too many positional arguments), got: {:?}\",\n".to_string()), " surplus.diagnostics\n".to_string()), " );\n".to_string()), " // POSITIVE CONTROLS at ZERO diagnostics of any severity (the filtering\n".to_string()), " // lesson of codex review 45357: asserting only the absence of the\n".to_string()), " // blocking variant lets an advisory pass unnoticed). Correct labels,\n".to_string()), " // correct positional binding, and the deliberately-unused-parameter\n".to_string()), " // idiom (label `ctx` against declared `_ctx` — the interpreter accepts\n".to_string()), " // it, so the compile seam must too) all stay silent.\n".to_string()), " let green = compile_one(\n".to_string()), " \"green.dag\",\n".to_string()), " \"module green\\nfn sub(a: Int, b: Int) -> Int { a - b }\\nfn ignore_ctx(_ctx: Int, b: Int) -> Int { b }\\nfn named() -> Int { sub(a: 10, b: 3) }\\nfn positional() -> Int { sub(10, 3) }\\nfn underscore_idiom() -> Int { ignore_ctx(ctx: 1, b: 2) }\\n\",\n".to_string()), " );\n".to_string()), " assert!(\n".to_string()), " green.diagnostics.is_empty(),\n".to_string()), " \"correct call shapes must compile with NO diagnostic of any severity, got: {:?}\",\n".to_string()), " green.diagnostics\n".to_string()), " );\n".to_string()), " })\n".to_string()), " .expect(\"failed to spawn thread\")\n".to_string()), " .join();\n".to_string()), " result.expect(\"call_shape_wall_witness panicked\");\n".to_string()), " }\n\n".to_string())
}
Expand Down Expand Up @@ -369,5 +365,5 @@ pub fn ct_declared_type_conformance_witness_test() -> String {
}

pub fn compiler_tests_source() -> String {
v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(ct_module_header(), ct_workspace_helpers()), ct_file_discovery_helpers()), ct_source_builders()), ct_tokenizer_tests()), ct_parse_tests()), ct_pipeline_test()), ct_unlisted_import_use_witness_test()), ct_call_shape_wall_witness_test()), ct_call_deficit_red_witness_test()), ct_call_shape_duplicate_wall_witness_test()), ct_function_value_named_application_controls_witness_test()), ct_function_value_field_method_known_hole_probe_test()), ct_method_existence_wall_witness_test()), ct_declared_type_conformance_witness_test()), ct_sole_constructor_test()), ct_constructor_call_admission_test()), ct_constructor_call_admission_same_module_sibling_test()), ct_constructor_call_admission_function_value_test()), ct_constructor_call_admission_zero_arity_test()), ct_constructor_call_admission_shadowing_test()), ct_constructor_call_admission_qualified_caller_test()), ct_sole_constructor_fieldless_witness_test()), ct_contracts_sidecar_witness_test()), ct_caret_parse_smoke_native_witness_tests()), ct_self_parse_all_test()), ct_self_resolve_test()), ct_self_compile_test()), ct_self_compile_cargo_check_test()), ct_type_size_test()), ct_coercion_tests()), ct_profile_helpers()), ct_profile_self_compile_test()), ct_profile_full_pipeline_test()), ct_profile_reconcile_test()), ct_module_footer())
v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(v1_rt::concat(ct_module_header(), ct_workspace_helpers()), ct_file_discovery_helpers()), ct_source_builders()), ct_tokenizer_tests()), ct_parse_tests()), ct_pipeline_test()), ct_unlisted_import_use_witness_test()), ct_call_shape_wall_witness_test()), ct_call_deficit_red_witness_test()), ct_call_shape_duplicate_wall_witness_test()), ct_function_value_named_application_controls_witness_test()), ct_function_value_field_method_known_hole_probe_test()), ct_method_existence_wall_witness_test()), ct_declared_type_conformance_witness_test()), ct_sole_constructor_test()), ct_constructor_call_admission_test()), ct_constructor_call_admission_same_module_sibling_test()), ct_constructor_call_admission_function_value_test()), ct_constructor_call_admission_zero_arity_test()), ct_constructor_call_admission_shadowing_test()), ct_constructor_call_admission_qualified_caller_test()), ct_sole_constructor_fieldless_witness_test()), ct_contracts_sidecar_witness_test()), ct_self_parse_all_test()), ct_self_resolve_test()), ct_self_compile_test()), ct_self_compile_cargo_check_test()), ct_type_size_test()), ct_coercion_tests()), ct_profile_helpers()), ct_profile_self_compile_test()), ct_profile_full_pipeline_test()), ct_profile_reconcile_test()), ct_module_footer())
}
Loading