Skip to content

Close V0 release blockers (#50, #52) and drop out-of-support TFMs#101

Merged
matt-edmondson merged 2 commits into
vectorsfrom
fix/vectors-release-blockers
Jun 25, 2026
Merged

Close V0 release blockers (#50, #52) and drop out-of-support TFMs#101
matt-edmondson merged 2 commits into
vectorsfrom
fix/vectors-release-blockers

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Closes the two release blockers from #100

Blocker 1 — V0 non-negativity (#50) and absolute-difference subtraction (#52)

Both were already implemented in the generator, but the covering tests were left [Ignore]d:

  • V0 From{Unit} factories guard via Vector0Guards.EnsureNonNegative (runs after unit conversion, throws ArgumentException).
  • V0 - V0 emits Create(T.Abs(left - right)), so magnitude subtraction stays non-negative.

This un-skips and renames the three tests (Mass_From_Negative_Throws, Speed_From_Negative_Throws, Mass_Minus_Mass_Returns_Absolute_Difference) and refreshes their now-stale comments. Closes #50, closes #52.

Blocker 2 — drop out-of-support target frameworks

System.Text.Json 10 (and System.IO.Pipelines, System.Text.Encodings.Web, System.Runtime.CompilerServices.Unsafe) no longer ship assets for net5.0/net6.0/net7.0, which produced ~18 "doesn't support" warnings via Strings/Paths.

  • Semantics.Strings, Semantics.Paths: drop net5.0/net6.0/net7.0, keep net8.0net10.0 + netstandard2.0/2.1 (older consumers still resolve via netstandard, so this is non-breaking for them).
  • Semantics.Quantities: drop net7.0net8.0net10.0 floor (it needs INumber<T>, so no netstandard target).
  • Documented in docs/migration-guide-2.0.md.

Result

  • dotnet build -c Release: 0 errors, warnings down from 20 to 1 (a pre-existing CS8600 in LogarithmicScalesGenerator.cs:141, unrelated, not promoted to error).
  • Tests: 782 passed, 0 failed, 0 skipped.

Known follow-up (not in this PR)

The committed generated Units.g.cs reorders nondeterministically on each build (the FootPerSecond singleton moves). Worth making the UnitsGenerator output order deterministic so generated files don't churn.

#50/#52 were already implemented in the generator (V0 factories guard via
Vector0Guards.EnsureNonNegative; V0 - V0 returns T.Abs(left - right)) but the
covering tests were left [Ignore]d. Un-skip and rename them.

Drop net5.0/net6.0/net7.0: System.Text.Json 10 and friends no longer ship
assets for those runtimes (they are out of support). Strings/Paths keep
netstandard2.0/2.1 so older consumers still resolve; Quantities goes to net8.0
floor (it needs INumber<T>). Document the TFM change in the 2.0 migration guide.
The committed Units.g.cs predated the catalogue's ordinal sort, so every build
re-ordered one singleton (FootPerSecond) and showed the file dirty. The
generator is deterministic (verified: two clean builds are byte-identical), so
this is a one-time resync.

Add a standalone verify-generated workflow that rebuilds and fails if anything
under Semantics.Quantities/Generated/ drifts from its generator. Kept separate
from the centrally-synced dotnet.yml.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3 Security Hotspots
9.2% Coverage on New Code (required ≥ 80%)
C Security Rating on New Code (required ≥ A)
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@matt-edmondson matt-edmondson merged commit 8327fe1 into vectors Jun 25, 2026
5 of 8 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