Skip to content

feat(extensions): N-D projection overload to KnownFunctionLandscape (#1203) - #41

Merged
jsboige merged 1 commit into
mainfrom
feature/c706-nd-projection
Jul 20, 2026
Merged

jsboige merged 1 commit into
mainfrom
feature/c706-nd-projection

Conversation

@jsboige

@jsboige jsboige commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Scope

Add N-D projection overload to KnownFunctionLandscape, porting the verbatim MAX-of-uniform-samples projection pattern from the Gtk# LandscapeExplorerSampleController.GetFunctionValue (lines 640-674 @ d05826fd) to a public, deterministic, fully-typed bridge.

The verbatim upstream had a bug: coordsRange = min - min = 0, pinning the hidden coordinates to the lower bound and producing a flat, degenerate heatmap. The fix (coordsRange = max - min) is pinned by the G.9 non-vacuous test RenderHeatmap_NdProjection_HiddenCoordsAffectHeatmap.

Diff

  • 2 new public overloads of RenderHeatmap
  • 1 new internal sealed adapter NDMaxProjectionAdapter
  • 12 NUnit tests pinning the surface, the fix, the bounds, the guards (null, dim<2, nbSamples<1), and the convergence behaviour (sub-martingale maxRed)
  • 6 notebook smoke tests exercising each cell of MGS-7b-LandscapeMultidim

Verifications

  • dotnet build -c Release : 0 erreur
  • dotnet test : 180/180 PASS en 4s (174 existants + 6 smoke)
  • G.9 non-vacuous : reintroduction temporaire du bug coordsRange=0 -> 1 test FAIL = bug capte
  • 8 PNG assets generes par les smoke tests (Sphere 2D/5D, Rastrigin d=2/5/10/30, Schwefel d=5/30)

Consumer PR : jsboige/CoursIA#7583

Port the verbatim MAX-of-uniform-samples projection pattern from the Gtk#
LandscapeExplorerSampleController.GetFunctionValue (lines 640-674 @ d05826fd)
to a public, deterministic, fully-typed bridge in KnownFunctionLandscape.

The verbatim upstream had a bug: coordsRange = min - min = 0, pinning the
hidden coordinates to the lower bound and producing a flat, degenerate
heatmap. The fix (coordsRange = max - min) is pinned by the G.9 non-vacuous
test RenderHeatmap_NdProjection_HiddenCoordsAffectHeatmap (5D != 2D).

Two new public overloads:
- RenderHeatmap(IFitness, int dimension, int nbSamples, Random?, int, int)
- RenderHeatmap(IFitness, xRange, yRange, int dimension, int nbSamples, Random?, int, int)

12 NUnit tests pin the surface, the fix, the bounds, the guards (null, dim<2,
nbSamples<1), and the convergence behaviour (sub-martingale maxRed). Plus 6
notebook smoke tests that exercise each cell of MGS-7b-LandscapeMultidim.

180/180 tests pass.
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