Skip to content

Designs#44

Open
TimWhiting wants to merge 6 commits intoproj/rust-rewritefrom
tim/designs-2.0
Open

Designs#44
TimWhiting wants to merge 6 commits intoproj/rust-rewritefrom
tim/designs-2.0

Conversation

@TimWhiting
Copy link
Copy Markdown
Contributor

I've split the PR into commits that cover logically related changes (docs / frontend / eval / etc). The individual commits do not compile by themselves.

I'm targetting the docs branch for my docs for designs and the related changes to submodel / reference naming. That PR will come shortly.

Copilot AI review requested due to automatic review settings May 1, 2026 18:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@TimWhiting TimWhiting force-pushed the tim/designs-2.0 branch 5 times, most recently from 08864e0 to 2c7b06b Compare May 4, 2026 17:46
Copy link
Copy Markdown
Collaborator

@pixilcode pixilcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through commit by commit to review, I think everything looks good. I added a couple small changes, although they don't change the functionality at all. Feel free to use them or discard them.

Comment thread src-rs/oneil_ir/src/model_import.rs Outdated
Comment thread src-rs/oneil_ir/src/parameter.rs Outdated
Comment thread src-rs/oneil_ir/src/parameter.rs Outdated
Comment thread src-rs/oneil_parser/src/declaration.rs Outdated
Comment thread src-rs/oneil_analysis/src/validation.rs Outdated
Comment thread src-rs/oneil_eval/src/context.rs Outdated
TimWhiting and others added 6 commits May 5, 2026 19:36
- Add two-pass instance graph ADR
- Add architecture guide for design overlays
- Add designs-and-imports spec
- Update grammar spec
- Update README
- Update vscode syntax highlighting for new keywords

Co-authored-by: Cursor <cursoragent@cursor.com>
- Add DesignOverlay, DesignApplication, and DesignProvenance to oneil_ir
- Add EvalInstanceKey and RelativePath to oneil_shared
- Extend oneil_ir expressions with Variable classification (Parameter/Builtin/External)
- Extend oneil_ir model, model_import, parameter, and unit for instance graph
- Extend oneil_ast declarations for submodel/reference/alias/design syntax
- Add instance_path.rs and extend paths.rs in oneil_shared

Co-authored-by: Cursor <cursoragent@cursor.com>
- Parse .one design files with design target and overlay declarations
- Parse submodel, reference, and alias import declarations (replacing old use/ref)
- Parse extraction lists ([a as b, ...]) in submodel declarations
- Update keywords: submodel, reference, alias, design
- Improve parser error messages for new syntax

Co-authored-by: Cursor <cursoragent@cursor.com>
…ation

- Replace oneil_resolver with oneil_frontend: resolver + instance graph crates merged
- Implement two-pass compilation: per-unit resolution then design composition
- Build InstanceGraph with tree-structured InstancedModel nodes
- Apply design overlays via apply_chain with copy-on-write submodel instances
- Implement post-build validation: undefined parameters/references, parameter cycles
- Fold variable classification (classify_variables) into validation pass
- Unify error handling: InstanceValidationError and ContributionDiagnostic on InstanceGraph
- Surface generic "submodel has errors" diagnostics at import sites
- Make submodels/references/aliases maps explicitly disjoint on InstancedModel
- Remove design_target_declared dead-code guard (parser enforces the invariant)

Co-authored-by: Cursor <cursoragent@cursor.com>
- Rewrite eval to operate over InstanceGraph: seed subtree, evaluate per-instance
- Replace IrCache/TemplateCache with UnitGraphCache and EvalCache (keyed by EvalInstanceKey)
- Remove ExternalEvaluationContext::build_graph shim; runtime builds graphs directly
- Fold classify_variables into validate_instance_graph (pre-validation classification pass)
- Surface instance graph validation errors and contribution diagnostics via RuntimeError
- Update LSP to publish static diagnostics from instance graph validation
- Update CLI print_model_result to use unified ModelReference::references child map
- Minimize EvalCache diff: keep existing ModelCache helpers, add only genuinely new methods

Co-authored-by: Cursor <cursoragent@cursor.com>
- Add fixture files for design overlays, augmented refs, sibling designs,
  chain apply, with-clause extraction, overlay propagation, and error cases
- Add snapshot tests covering: design application, parameter augmentation,
  reference params, local parameters, nested params, anchor scope, two
  instances, unit mismatch, wrong target, compilation cycles, and more
- Remove old basic fixture files replaced by the new fixtures/ subdirectories
- Add fixtures/README.md documenting fixture conventions

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants