Repository navigation
extdeps loader close #776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
extdeps loader close #776
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f58fa55
WIP: extdeps loader close
briansrls 8df3bd1
Merge remote-tracking branch 'origin/main' into session/clever-owl-123
briansrls 917d7e4
Merge remote-tracking branch 'origin/main' into session/clever-owl-123
briansrls 342146c
WIP: extdeps loader close
briansrls 9591048
Merge remote-tracking branch 'origin/main' into session/clever-owl-123
briansrls 14c0c75
fix(v3): allow clippy::enum_variant_names in lens-generated modules
briansrls 11a50c2
WIP: extdeps loader close
briansrls 7bae979
Merge remote-tracking branch 'origin/main' into session/clever-owl-123
briansrls 6acadd4
feat(v3): Dag::rust_pilot_primitives accessor + Path 2 comment fix + …
briansrls 9d8d2a3
WIP: extdeps loader close
briansrls da3cc36
Merge remote-tracking branch 'origin/main' into session/clever-owl-123
briansrls 65a8109
chore(v3): regen_bootstrap authority labels name extdeps
briansrls 04b78f8
docs(v3): restore declaration_by_name docstring placement in dag.rs
briansrls b859354
Merge remote-tracking branch 'origin/main' into session/clever-owl-123
briansrls 6a64df7
Merge remote-tracking branch 'origin/main' into session/clever-owl-123
briansrls 658341f
Merge remote-tracking branch 'origin/main' into session/clever-owl-123
briansrls 98b8b61
WIP: extdeps loader close
briansrls File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
2,126 changes: 1,074 additions & 1,052 deletions
2,126
src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
src/v3/compiler/tests/integration/extdeps_rust_primitives_loader_test.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| //! **Layer:** integration | ||
| //! | ||
| //! T-Ground-Engine Phase-1 unblock (Path 2): `dsl/extdeps/languages/rust/ | ||
| //! primitives.dag` is loaded into the bootstrap Dag; `Dag::rust_pilot_primitives` | ||
| //! returns a walkable type-structure declaration. The 10-element pilot | ||
| //! enumeration is NOT walkable as structured records until R2 T-Substrate's | ||
| //! 4th sub-lane lands the top-level `ValueBody::List`/aggregate extension; | ||
| //! this test pins the currently-available type-structure access and | ||
| //! explicitly records the `ValueBody::Unparsed` boundary. | ||
|
|
||
| use v3_compiler::dag::{Dag, TypeConnective, ValueBody}; | ||
|
|
||
| #[test] | ||
| fn dag_new_exposes_rust_pilot_primitives_type_structure() { | ||
| let dag = Dag::new(); | ||
| assert!( | ||
| dag.diagnostics().is_empty(), | ||
| "bootstrap must be clean for extdeps loader-close, got {:?}", | ||
| dag.diagnostics() | ||
| ); | ||
|
|
||
| let decl = dag | ||
| .rust_pilot_primitives() | ||
| .expect("rust_pilot_primitives must be loaded from EXTDEPS_BOOTSTRAP_FIXTURES"); | ||
|
|
||
| // Req 2: stable shape, walkable structurally. | ||
| assert_eq!( | ||
| decl.span.file, "dsl/extdeps/languages/rust/primitives.dag", | ||
| "rust_pilot_primitives span must point at the authority file" | ||
| ); | ||
|
|
||
| // Top-level declaration is `List<RustPrimitive>` — an Instantiation | ||
| // connective parameterized over the RustPrimitive sum. | ||
| let rust_primitive_decl_id = match &decl.connective { | ||
| TypeConnective::Instantiation { arguments, .. } => { | ||
| assert_eq!( | ||
| arguments.len(), | ||
| 1, | ||
| "rust_pilot_primitives: List<RustPrimitive> has exactly one template argument" | ||
| ); | ||
| arguments[0].value | ||
| } | ||
| other => panic!( | ||
| "rust_pilot_primitives must lower to an Instantiation (List<RustPrimitive>), got {:?}", | ||
| other | ||
| ), | ||
| }; | ||
|
|
||
| // Walk through to the RustPrimitive sum and pin the two variants + | ||
| // their field labels. This is the type-structure-only walk that | ||
| // Engine sharpened-(b) Phase 1 consumes. | ||
| let rust_primitive = dag.declaration(rust_primitive_decl_id); | ||
| assert_eq!(rust_primitive.name.as_deref(), Some("RustPrimitive")); | ||
| let variants = match &rust_primitive.connective { | ||
| TypeConnective::Disj { variants } => variants, | ||
| other => panic!("RustPrimitive must be a Disj, got {:?}", other), | ||
| }; | ||
| let variant_labels: Vec<&str> = variants.iter().map(|f| f.label.as_str()).collect(); | ||
| assert_eq!( | ||
| variant_labels, | ||
| vec!["IntegerPrimitive", "NonIntegerPrimitive"], | ||
| "pilot scope is integer/non-integer split per primitives.dag authority" | ||
| ); | ||
|
|
||
| let integer_variant = dag.declaration(variants[0].ty); | ||
| let integer_field_labels: Vec<&str> = match &integer_variant.connective { | ||
| TypeConnective::Conj { children } => children.iter().map(|f| f.label.as_str()).collect(), | ||
| other => panic!( | ||
| "IntegerPrimitive payload must be a Conj record, got {:?}", | ||
| other | ||
| ), | ||
| }; | ||
| assert_eq!( | ||
| integer_field_labels, | ||
| vec!["target_name", "algebra", "carrier", "is_copy", "overflow"], | ||
| "IntegerPrimitive field order is load-bearing for T-Ground L4-(C) witness consumption" | ||
| ); | ||
|
|
||
| let non_integer_variant = dag.declaration(variants[1].ty); | ||
| let non_integer_field_labels: Vec<&str> = match &non_integer_variant.connective { | ||
| TypeConnective::Conj { children } => children.iter().map(|f| f.label.as_str()).collect(), | ||
| other => panic!( | ||
| "NonIntegerPrimitive payload must be a Conj record, got {:?}", | ||
| other | ||
| ), | ||
| }; | ||
| assert_eq!( | ||
| non_integer_field_labels, | ||
| vec!["target_name", "algebra", "carrier", "is_copy"], | ||
| "NonIntegerPrimitive is structurally missing `overflow` (state-space discipline)" | ||
| ); | ||
| } | ||
|
|
||
| #[test] | ||
| fn rust_pilot_primitives_value_body_is_unparsed_until_r2_substrate_4th_sublane() { | ||
| // Boundary pin: the 10-element pilot list stays unparsed at the | ||
| // top-level `data ... = [...]` body because v3's `ValueBody` enum | ||
| // lacks a top-level list/aggregate variant. When R2 T-Substrate's | ||
| // 4th sub-lane (top-level `ValueBody::List`/aggregate extension) | ||
| // lands, this assertion flips and Engine sharpened-(b) Phase 2 can | ||
| // re-dispatch against structured records. See | ||
| // `docs/r2-structure.md` 4th sub-lane scoping. | ||
| let dag = Dag::new(); | ||
| let decl = dag.rust_pilot_primitives().expect("loaded"); | ||
| let body = decl | ||
| .value_body | ||
| .as_ref() | ||
| .expect("data declarations carry a value_body"); | ||
| assert!( | ||
| matches!(body, ValueBody::Unparsed(_)), | ||
| "rust_pilot_primitives.value_body must stay Unparsed until ValueBody grows a \ | ||
| top-level list/aggregate variant; got {body:?}. If this test flips to failing \ | ||
| because the body is now structured, update Engine sharpened-(b) Phase 2 \ | ||
| consumers to walk the structured value and delete this assertion." | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
EXTDEPS_BOOTSTRAP_FIXTUREShere changes only the runtime assembly path, butDag::new()still clones the committed generated snapshots (bootstrap_generated*.rs). Because those generated files were not updated in this commit, generated and runtime bootstraps now diverge (the PB-1 snapshot equivalence tests report declaration-count mismatches), so production bootstrap still omits the new extdeps declarations until regen output is committed.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale on current tip. Verified: snapshots were regenerated after my initial WIP.
The WIP commit that landed
EXTDEPS_BOOTSTRAP_FIXTURESalso regeneratedbootstrap_generated.rs/bootstrap_generated_without_parse_surface.rs/bootstrap_std_generated.rs(viacargo run -p v3-compiler --bin regen_bootstrap); the same commit also regenerated eight lens modules that walkDisjdeclarations (cost, cost_symbolic, provenance, structural_resolution, unused_parameters, variant_payload, infer_helpers, lower_helpers) so theTargetCarrier/RustPrimitiveenums land in every generated consumer.PB-1 drift tests —
pb1_bootstrap_full_snapshot_test::generated_full_bootstrap_snapshot_matches_runtime_full_bootstrap,..._without_parse_surface_matches_runtime_variant, anddag_new_bootstrap_is_clean_and_byte_stable— are green in the latestcargo test --workspace --exclude v2-compiler-testsrun cited in the PR body. You were likely looking at the pre-regen WIP (f58fa555f); head is now6acadd450.