Skip to content

Reduction and aggregation operators lead their names, and five measurement-destination loci are registered - #34

Merged
Simon-McIntosh merged 4 commits into
iterorganization:mainfrom
Simon-McIntosh:main
Sep 7, 2026
Merged

Reduction and aggregation operators lead their names, and five measurement-destination loci are registered#34
Simon-McIntosh merged 4 commits into
iterorganization:mainfrom
Simon-McIntosh:main

Conversation

@Simon-McIntosh

Copy link
Copy Markdown
Collaborator

Three grammar rulings, each landed with its own test coverage, plus the locus registrations the last of them needs.

What changed

A domain reduction leads its name and wraps the projection. Every spelling of a reduced quantity now shares one intermediate representation, so toroidal_flux_surface_averaged_current_density and flux_surface_averaged_toroidal_current_density no longer denote the same quantity under two names — the second is canonical and the first is refused.

An aggregation token leads its name joiner-free. root_mean_square joins the bare-prefix operators and accumulated keeps its leading seat, so accumulated_radiated_energy_due_to_impurity_radiation is canonical rather than radiated_energy_accumulated_due_to_impurity_radiation.

Five diagnostic measurement-destination loci are registered. A quantity measured by a specific instrument can now name where it was measured instead of collapsing onto one generic measurement position, so a Doppler reflectometer, a Langmuir probe and an ECE channel each carry their own locus. The locus registry moves from 181 to 186 entries and the generated model types follow.

Measured effect on a live catalog

Parsing and re-composing 2348 accepted standard names against this grammar in a fresh interpreter:

Result Count
Renders exactly as spelled 2322
Accepted but renders differently 0
Refused as non-canonical or ungrammatical 26

The zero is the load-bearing number: there is no name this grammar accepts and then renders under a different spelling, so parser and renderer agree on everything they admit. The 26 refusals are names still carrying a pre-ruling spelling, and they fall into exactly two families with no unexpected shapes — 23 in the reduction and aggregation re-render cohort, every pair carrying an identical intermediate representation and therefore a re-rendering rather than a change of meaning, and 3 carrying a safety-factor locus in a non-absolute form whose absolute-form successors already exist.

Compatibility

A consumer holding one of the 23 affected spellings will find it refused rather than silently reinterpreted, which is why this is proposed as a minor rather than a patch release: the previous grammar releases in this series were additive, and this one reverses the canonical position of an operator family.

…its leading seat

The two aggregation tokens now render one canonical spelling per quantity,
leading and joiner-free, like the flux-surface-average family.

root_mean_square joins BARE_PREFIX_OPERATORS, which makes it a
precedence-30 domain reduction: its operand is the whole projected,
qualified quantity, so it leads and drops the _of_ joiner
(root_mean_square_wave_current_of_antenna_strap). The unary _of_ peel now
carries the bare flag for reduction-class operators, so an _of_-authored
spelling (root_mean_square_of_wave_current_of_antenna_strap) shares one
representation with the bare form and renders to it; strict admits
exactly the bare spelling.

accumulated stays a qualifier in the intermediate representation - none of
the sixteen accepted names changes what the token is - but the renderer no
longer relocates the accumulation family (accumulated, cumulative,
cumulative_inside_flux_surface) between the base and a trailing locus. It
keeps its leading seat, so neutral_count_accumulated_at_wall converges to
accumulated_neutral_count_at_wall. normalized, perturbed and change_in
keep their existing placement.
Add reflectometer_cutoff_position, charge_exchange_channel,
thomson_scattering_channel_position, langmuir_probe_position and
calorimetry_component to the locus registry as position-typed tokens
carrying the of and at relations, so a quantity whose instrument is
known evaluates at that instrument's sampling location instead of the
generic measurement_position locus. Each token is distinct from the
existing hardware-entity token of the same instrument (langmuir_probe,
ece-style channel entities are the channel object, not the sampled
place).

Redefine measurement_position in place to state what the location is:
the position in the cylindrical frame at which a diagnostic channel
samples, used for the coordinates of that position where the coordinate
serves many instrument families. Type and relations are unchanged.

Regenerate grammar model_types.py so the strict validation path resolves
the new position tokens.
Registers the destination loci that let a diagnostic quantity name where it was
measured instead of collapsing onto one generic measurement position, so a
Doppler reflectometer, a Langmuir probe and an ECE channel each name their own
locus.
@Simon-McIntosh
Simon-McIntosh merged commit 2ffba62 into iterorganization:main Sep 7, 2026
5 checks passed
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.

1 participant