Skip to content

Build the samples against the source, not a package from two majors ago - #846

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
chore/samples-use-project-reference
Aug 9, 2026
Merged

Build the samples against the source, not a package from two majors ago#846
Rafael-SOWNet merged 1 commit into
masterfrom
chore/samples-use-project-reference

Conversation

@Rafael-SOWNet

@Rafael-SOWNet Rafael-SOWNet commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Answers the question of whether the samples need pinning at all. Measured: they do not, and the pin was actively hiding a bug.

The change

SampleNet5 referenced AngouriMath 1.3.0 and FSharpSample referenced AngouriMath.FSharp 1.3.0, while every other project in the solution uses a ProjectReference. Both now do too.

The usual argument for a PackageReference in a sample is that it demonstrates what a consumer actually gets. This pin did not do that — it demonstrated neither the current source nor the current release, only January's 1.3.0. What it did do was keep the samples out of every tree-wide change: the Latexise rename in #842 swept the whole repository and skipped them silently, which is how I found them.

SampleNet5 needed the rename applied. FSharpSample needed nothing.

What running them turned up

Building was not enough. Both samples compiled clean and then crashed, in the same place:

FunctionArgumentCountException: integral should have exactly 4 arguments
or 2 arguments but 3 arguments are provided

Both called integral(f, x, 1). Measured across three published versions rather than inferred:

version integral(f, x, 1) derivative(f, x, 1)
1.3.0 acceptedintegral(f, x) accepted
1.4.0 throws accepted
2.0.0-preview.1 throws accepted

So this is not a 2.0 change — it shipped in 1.4.0. Both samples have been broken against the current release since January, and the 1.3.0 pin is exactly why nobody could see it.

They now use the two-argument form, which is what 1.3.0 turned the three-argument one into anyway (integral(f, x, 1) printed as integral(f, x)), so the samples are unchanged in meaning.

Filed separately as #847, since whether integral should regain the three-argument form — or whether derivative keeping it is the inconsistency — is a decision rather than a cleanup.

Measured

[0] Samples/SampleNet5/SampleNet5.csproj   :: 0 err, 0 warn
[0] Samples/FSharpSample/FSharpSample.fsproj :: 0 err, 0 warn

Both run to completion against 2.0. SampleNet5's last line:

{x}^{y}+\sqrt{x}+\int \frac{\sqrt{x}}{a}\,\mathrm{d}x+\frac{\mathrm{d}}{\mathrm{d}x}\frac{\sqrt{x}}{a}+\lim_{x\to \infty } \frac{\sqrt{x}}{a}

Worth considering separately

Nothing builds or runs these in CI. That is what let a sample stay broken for seven months. A job that runs both would have caught it the week it happened, and would catch the next one.

🤖 Generated with Claude Code

SampleNet5 referenced AngouriMath 1.3.0 and FSharpSample AngouriMath.FSharp
1.3.0, while every other project in the solution uses a ProjectReference. The
pin did not serve the purpose a PackageReference usually has -- demonstrating
what a consumer gets -- because it demonstrated neither the current source nor
the current release, only January's 1.3.0. What it did do was keep the samples
out of every tree-wide change: the Latexise rename swept the whole repository
and silently skipped them.

Both now reference the projects. SampleNet5 needed the rename applied; F# needed
nothing.

Running them, rather than only building them, turned up something the pin had
been hiding for seven months. Both samples called integral(f, x, 1), which 1.3.0
accepted and read as integral(f, x). It has thrown FunctionArgumentCountException
since 1.4.0, so both samples have been broken against the current release since
January and nobody could see it. Measured across three published versions rather
than inferred. They now use the two-argument form, which is what 1.3.0 turned
the three-argument one into anyway, so the samples are unchanged in meaning.

Both run to completion against 2.0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Rafael-SOWNet
Rafael-SOWNet merged commit 59db007 into master Aug 9, 2026
24 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the chore/samples-use-project-reference branch August 9, 2026 15:49
Rafael-SOWNet added a commit that referenced this pull request Aug 9, 2026
…ken (#849)

Nothing built anything under Sources/Samples. That is what let SampleNet5 and
FSharpSample stay broken against the current release for seven months while
looking healthy -- pinned to 1.3.0, they compiled against a version that still
accepted integral(f, x, 1). Unpinning them in #846 was only half the fix.

Building is not enough either: both compiled cleanly and threw at runtime, so
the four console samples are run as well, about two seconds each.

Writing this found a third. FSharpPlayground already used a ProjectReference,
so nothing was concealing it -- it was broken on master, on the same call, and
no job noticed because no job ran it. Fixed here.

AngouriMathPlot and GraphicExample are built but not run, being windowed;
InteractivePlayground is built but not run because Plotly opens a browser.
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