You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No data size or data rate types: add an Information dimension (bit/byte, KB and KiB) and DataRate = DataSize / Time #366
Phase 6 of the semantic-domains roadmap proposes data size and data rate types. The roadmap recommends generating them by adding an Information dimension to the quantity metadata. None of it exists yet: Semantics.SourceGenerators/Metadata/dimensions.json has no Information dimension, and units.json has no bit or byte units.
DataSize (bytes) with binary (KiB/MiB) and decimal (KB/MB) prefixes, DataRate (bit/s), the integral/derivative relationship between them over Time.
Generator vs. hand-written: strongly consider adding Information as a dimension in dimensions.json (unit = byte/bit) so DataSize/DataRate fall out of the existing machinery, including the DataRate = DataSize / Time relationship.
Open question 4 (L231-L232) also recommends the generator approach. The roadmap describes itself as a proposal rather than a commitment, so whether this is still wanted is your call. It rates this phase S–M effort, and it depends only on the existing Quantities generator.
Why it matters
Without these types, consumers keep file sizes and bandwidths as bare long or double. Two mix-ups then go unnoticed:
bits vs bytes (a factor of 8)
kB vs KiB (1000 vs 1024)
For example, a 100 Mbit/s link carrying a 1 GiB file takes about 86 s, but adding a bits-per-second value to a bytes figure compiles without complaint. The roadmap also treats this phase as the cleanest test of whether the generator can take on a new dimension.
Design point to settle first
Information has no SI base exponent. Each dimensionalFormula in dimensions.json is written over the SI base dimensions (plus angle), and the C++ projection (Semantics.Cpp) maps each dimension onto those exponents. An Information dimension therefore needs one of two things before the metadata is edited:
a new axis, which would change the C++ dimension prelude and the dimension info the .NET side carries
a documented decision to put it on the dimensionless vector and rely on the nominal type layer alone
SEM008 relationship checking and the C++ nominal classes both depend on which way this goes.
Acceptance criteria
Units: an Information dimension (or a documented hand-written alternative) with bit and byte units.
Prefixes: decimal prefixes (kB, MB, GB) and binary prefixes (KiB, MiB, GiB) both convert exactly. magnitudes.json holds only SI prefixes, so the binary factors need their own entries.
Rate: a DataRate dimension (bit/s, byte/s and prefixed forms), and the DataSize / Time -> DataRate relationship in the integrals/derivatives metadata. Operators are generated and SEM008 passes.
Generated files: alias props regenerated with scripts/Generate-AliasProps.ps1, and generated sources committed so verify-generated passes.
C++: the C++ projection still compiles (Semantics.Cpp.Test).
Tests: unit conversions, including KiB vs kB and bit vs byte, plus the rate relationship.
Category: Feature Request (roadmap Phase 6, Information dimension, DataSize and DataRate)
Priority: Low. This is a proposed roadmap item and nothing is broken. It is still a useful test of how far the generator extends.
Area:Semantics.SourceGenerators/Metadata (dimensions.json, units.json, magnitudes.json for the binary prefixes), the integrals/derivatives relationships, and the Semantics.Cpp dimension prelude. Suggested owner: @matt-edmondson, quantity generator. Settle the design point first: either a new dimension axis, or putting Information on the dimensionless vector. SEM008 and the C++ projection both depend on that choice.
Activity
matt-edmondson commentedon Oct 5, 2026
Triage
Informationdimension,DataSizeandDataRate)Semantics.SourceGenerators/Metadata(dimensions.json,units.json,magnitudes.jsonfor the binary prefixes), the integrals/derivatives relationships, and theSemantics.Cppdimension prelude. Suggested owner: @matt-edmondson, quantity generator. Settle the design point first: either a new dimension axis, or puttingInformationon the dimensionless vector. SEM008 and the C++ projection both depend on that choice.Generated by Claude Code