Skip to content

v0.0.1-alpha.32

Choose a tag to compare

@github-actions github-actions released this 01 Oct 15:46
Immutable release. Only release title and notes can be modified.
1df9dbc

This release includes a major internal refactor of the compiler and evaluator that encodes invariants in types rather than conventions.
Along the way, it fixes a series of name-resolution and dimension-checking bugs, some of which allowed dimensionally wrong programs to pass type checking.

Some existing Graphcal source programs may need to be modified. Most of the breaking changes reject programs that were previously accepted only because of a bug. See Breaking Changes.

Breaking Changes

Name Resolution and Imports

  • The undocumented legacy spelling @alias.member for namespace members has been removed.
    Use @alias::member.
    A . after a graph reference is now always field access, so @inst.out on a struct node named inst no longer silently resolves to an include member instead of the field.
    (#1722)
  • An include or import alias can no longer share its name with a local declaration.
    For example, include d(...) as inst; together with node inst is now rejected with N001, matching the existing cross-file behavior.
    An alias that only respells its own one-segment local DAG is still allowed.
    (#1780)
  • A file submodule lib/x.gcl and an inline dag x in lib.gcl are now reported as an explicit module-path ambiguity instead of one taking priority.
    A module alias l for lib.gcl no longer reaches the file submodule through l.x.
    (#1782)
  • In package mode, an inline-DAG body import that escapes the package root, for example, through a symlink, is now rejected with ImportOutsideRoot, as file-root imports and loose mode already were.
    (#1789)

Dimension and Unit Checking

  • Dimension names in dim declarations, unit declarations, and required coordinate indexes are now resolved by qualified name. Previously they were looked up by leaf name against a flat table, so a qualified name could resolve to the wrong module, an unbound qualifier such as zzz::Length was accepted, and a dimensionally wrong program could pass type checking. (#1723)
  • A renamed selective import or include projection (dim X as Y, unit X as Y) now binds only the local name Y. The source name X no longer leaks into dim, unit, and const unit declarations. Unit aliases also resolve correctly inside unit expressions. (#1750, #1760)
  • An included DAG's dimension no longer replaces the importer's dimension of the same name. Programs that relied on that replacement are now checked against the importer's own definition. (#1763)
  • Rebinding a defaulted bindable dimension, such as pub(bind) dim Q = Length; with include lib(dim Q: Mass, ...), is now honored for file modules, inline DAGs, and nested includes. Programs that type-checked only because the rebinding was ignored are now rejected. (#1821)
  • An unused inline DAG whose dim or unit declarations name the parent's bare dimensions or units is now rejected, consistent with the included case. An inst::X include alias is no longer accepted in dim or unit declarations. (#1807)
  • A dimension exponent of exactly −2³¹ is now rejected with DimensionOverflow. (#1740)

Newly Accepted Programs

  • A derived dimension over a bindable dimension can now be projected through an include, for example pub(bind) dim Q; pub dim QR = Q / Time; used as include blib(dim Q: Length)::{dim QR, rate}. (#1763)
  • A projected dimension bound to an importer-local dimension is specialized, type-system self-imports of an included inline DAG resolve, and a specialized projected type may reference other template types. (#1807)
  • Selective includes of a const node from an inline DAG, such as include lib(v: @x)::{ k as kk }, now work. (#1783)
  • import plugin inside a nested dag body now works. The plugin is loaded, validated, policy-checked, and pinned by graphcal deps lock, and a missing .wasm file is reported at its import. (#1721)

Bug Fixes

  • graphcal model serve rows now evaluate assertions projected from included DAGs, so a row with a failing included assertion is no longer reported as a success. A runtime error inside an included DAG is reported as a row failure instead of terminating the server. (#1718, #1855)
  • A cycle through an include port binding, such as include lib(x: @a) as inst; node a = @inst::out;, is now reported as CyclicDependency by graphcal check instead of failing at evaluation with an internal error. The node reported for longer cycles is now deterministic. (#1826)
  • When an included assertion was the target of #[assumes] both inside its DAG and through an include projection, one of the links could be lost depending on hash order. Both are now kept. (#1806)
  • A scan whose union accumulator starts from a constructor with a converted field and whose step returns another constructor no longer fails with internal error X001. (#1863)
  • Several defects that surfaced as internal errors now report proper diagnostics. These include an import/include name clash (now N001), a mismatched dimension variable bound by an array parameter in an extern signature (now D001), and a dimension exponent that overflows through a template binding (now D010). Diagnostics also no longer leak dependency-private dimension names. (#1783, #1807, #1922)
  • Equality of public struct values now distinguishes constructors and generic arguments, so Coast and Burn of one union type, or Framed<Eci> and Framed<Ecef>, no longer compare equal. Rendered output is unchanged. (#1719)

Clearer Failure Reports

  • BLOCKED, TODO, and failed-dependency lists, as well as "dependency failed" messages, now show output names such as l::pending instead of internal identities such as src.demo.main.<include@44>.pending. This applies to CLI text, JSON, Wasm, and model outputs. JSON failed_deps now carries full output names instead of leaf names. (#1923)
  • Composed plots name each unavailable plot the way the root names it, for example dependency failed: broken, shown instead of main.broken, main.<include@109>.inner. (#1861)
  • A failing private value of an aliased include is labelled with the alias, and --output-view all lists instance values under the alias without duplicate copies under the module name. (#1855)
  • Instance plot axes for a rebound dimension port show the bound dimension. (#1821)
  • Independent parameters, nodes, and constants are evaluated in source order. (#1826)

Branding and Documentation

  • The README and the English and Japanese documentation headers now show the Graphcal wordmark, with theme-aware variants for light and dark palettes. The README was trimmed to the essentials. (#1698, #1699, #1903)
  • Documentation builds no longer depend on experimental browser tests. (#1706)

Dependency, Toolchain, and Workflow Maintenance

Internal

  • Completed Phases 0–10 of the invariant/complexity refactor. Highlights:
    • Typed names, qualified paths, parse errors, and module paths replace string encodings. A single resolver with typed symbols and typestate construction replaces the alias-keyed registry. (#1727–#1735, #1748, #1764–#1785, #1789, #1791)
    • HIR is parameterized by completeness and keyed by resolved declaration identities. Static definitions are evaluated canonically on demand. (#1788–#1810)
    • Type checking produces a unified CheckedType, typed diagnostics, and typed expression trees (TExpr) that the evaluator executes directly. Checked programs are sealed with their schedules and constant pools. (#1811–#1837)
    • Evaluation plans are indexed over borrowed sealed programs, and runtime values, keys, presentations, and built-in calls are typed by construction. (#1840–#1871)
    • Project loading moved into graphcal-project. Module cycles were removed, GraphcalError was replaced by per-phase typed errors with structural cancellation, and internal-error construction points were reduced. (#1874–#1887, #1917, #1918, #1920, #1922, #1923)
    • Shared foundations: phase-lift and format-equivalence derives, Outcome/Diagnostic, DependencyOrdered/DependencyGraph, a single Ratio<T>, SparseMonomial, checked unit scales, and typed built-in families. (#1736, #1737, #1739–#1741, #1743, #1744, #1746, #1747, #1749, #1751, #1752, #1754, #1755, #1758, #1761, #1762)
  • Added a ratcheted refactor-metrics check, an output golden for every checked-in Graphcal source, and a generated, CI-checked reading order in the codebase reading guide. (#1715, #1716, #1757)
  • Brought internal documentation in line with the code. (#1714, #1924)
  • Stabilized report browser tests and tracked mutation-test findings. (#1685, #1700, #1671, #1775)
  • Bumped the workspace version to v0.0.1-alpha.32. (#1926)

Full Changelog: v0.0.1-alpha.31...v0.0.1-alpha.32