Repository navigation
SG-6 #560
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
SG-6 #560
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
c7d1e8e
WIP: SG-6
briansrls 6a80ac3
WIP: SG-6
briansrls ac21a2e
WIP: SG-6
briansrls ca9da6a
WIP: SG-6
briansrls 59ce95e
WIP: SG-6
briansrls 4502391
WIP: SG-6
briansrls 68ba0fc
chore: apply cargo fmt
briansrls 900c03c
WIP: SG-6
briansrls 8614fba
WIP: SG-6
briansrls 960800d
WIP: SG-6
briansrls 1c8c7b8
WIP: SG-6
briansrls ecfc119
WIP: SG-6
briansrls 0ea33a0
WIP: SG-6
briansrls 0b063c4
WIP: SG-6
briansrls 4bf4c8d
WIP: SG-6
briansrls 368e6c8
WIP: SG-6
briansrls 8e4d880
WIP: SG-6
briansrls d064848
WIP: SG-6
briansrls bef5cdd
WIP: SG-6
briansrls 0df48cb
WIP: SG-6
briansrls c4788d1
WIP: SG-6
briansrls 344a7e5
WIP: SG-6
briansrls e8f5ccf
WIP: SG-6
briansrls e03d075
WIP: SG-6
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
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,78 @@ | ||
| module v3.compiler.regen | ||
|
|
||
| import std.types { FilePath, NonEmptyStr } | ||
|
|
||
| // Lens regen registry. Each `data <name>_entry: LensRegistryEntry` | ||
| // record below is picked up structurally by the `regen_lens` binary | ||
| // (`dag.declarations().filter(meta_tag == LensRegistryEntry)`), which | ||
| // then reads `lens_file`, emits the Rust projection via | ||
| // `emit_rust_module`, and writes to `generated_file`. Mirrors the | ||
| // `PipelineStageBinding` pattern in `src/v3/compiler/pipeline.dag`. | ||
| // | ||
| // Adding a new generated lens is a pure `.dag` edit: drop the lens | ||
| // source in `src/v3/lenses/`, add a `data ..._entry: LensRegistryEntry` | ||
| // record here with the three paths filled in, and | ||
| // `cargo run -p v3-compiler --bin regen_lens` picks it up. No | ||
| // per-lens Rust driver is added or edited. | ||
| // | ||
| // `name` composes from `std.types::NonEmptyStr` (= `String where | ||
| // non_empty`) so the `--lens <name>` selector key cannot encode an | ||
| // empty string. `lens_file` and `generated_file` compose from | ||
| // `std.types::FilePath` (also `String where non_empty`) per | ||
| // MODELING M9 — every field attaches to the existing path/identifier | ||
| // vocabulary rather than reintroduce a raw `String`. Refinement | ||
| // means empty-string entries cannot be lowered into the registry, | ||
| // closing the "illegal states representable" hole that a raw | ||
| // `String` would leave open across all three fields. | ||
|
|
||
This comment was marked as resolved.
Sorry, something went wrong. |
||
| type LensRegistryEntry { | ||
| name: NonEmptyStr | ||
| lens_file: FilePath | ||
| generated_file: FilePath | ||
| } | ||
|
|
||
| data lens_cost_entry: LensRegistryEntry = { | ||
| name: "cost" | ||
| lens_file: "src/v3/lenses/complexity.dag" | ||
| generated_file: "src/v3/compiler/src/lens_cost_generated.rs" | ||
| } | ||
|
|
||
| data lens_cost_symbolic_entry: LensRegistryEntry = { | ||
| name: "cost_symbolic" | ||
| lens_file: "src/v3/lenses/cost.dag" | ||
| generated_file: "src/v3/compiler/src/lens_cost_symbolic_generated.rs" | ||
| } | ||
|
|
||
| data lens_provenance_entry: LensRegistryEntry = { | ||
| name: "provenance" | ||
| lens_file: "src/v3/lenses/provenance.dag" | ||
| generated_file: "src/v3/compiler/src/lens_provenance_generated.rs" | ||
| } | ||
|
|
||
| data lens_structural_resolution_entry: LensRegistryEntry = { | ||
| name: "structural_resolution" | ||
| lens_file: "src/v3/lenses/structural_resolution.dag" | ||
| generated_file: "src/v3/compiler/src/lens_structural_resolution_generated.rs" | ||
| } | ||
|
|
||
| data lens_unused_parameters_entry: LensRegistryEntry = { | ||
| name: "unused_parameters" | ||
| lens_file: "src/v3/lenses/unused_parameters.dag" | ||
| generated_file: "src/v3/compiler/src/lens_unused_parameters_generated.rs" | ||
| } | ||
|
|
||
| // Absorbed from SG-4 prep (PR #562): `regen_infer_helpers.rs` was | ||
| // landed as a per-file regen driver mirroring the deleted | ||
| // `regen_lens_*` bins, explicitly flagged in its own header as | ||
| // "SG-6 owns folding all of these into a single generic regen | ||
| // target". This is that absorption. `infer_helpers.dag` is a lens | ||
| // in the broad sense the registry uses (reads substrate Dag, emits | ||
| // a Rust module via `emit_rust_module`), so it fits the existing | ||
| // `LensRegistryEntry` shape without a rename. A future `.dag` | ||
| // artifact that is genuinely non-lens would trigger the widening | ||
| // to a `GeneratedArtifactEntry` carrier. | ||
| data lens_infer_helpers_entry: LensRegistryEntry = { | ||
| name: "infer_helpers" | ||
| lens_file: "src/v3/lenses/infer_helpers.dag" | ||
| generated_file: "src/v3/compiler/src/infer_helpers_generated.rs" | ||
| } | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.