Skip to content

fix(analysis)!: pass Exaflow results through unchanged and pin the t-test contract of PR #656 - #43

Merged
KFilippopolitis merged 4 commits into
masterfrom
feat/ttest-corrections-support
Oct 28, 2026
Merged

KFilippopolitis merged 4 commits into
masterfrom
feat/ttest-corrections-support

Conversation

@KFilippopolitis

@KFilippopolitis KFilippopolitis commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Exaflow PR #656 (algorithms/t-test-corrections) changes t-test values,
not their shape: one-sided bounds use t_{1-alpha}, p-values come from
the survival function (3.9e-235 instead of 0), a one-row group no
longer nulls the independent t-test, and the paired spec now labels x
"Measurement 1" and y "Measurement 2" (mean_diff = x - y).

Backend fix: results pass through as Exaflow sent them

Results used to be parsed with Gson and written back with Spring's
Jackson. That changed them in two ways:

  • Gson turned every number into a double (n_obs: 217 reached the UI as 217.0);
  • application.yml's non_null inclusion dropped every null inside a
    result, at any depth (a t-test p: null disappeared).

AnalysisService now returns a 200 body as RawJson, and
ExperimentDTO serves a stored result as RawJson. Jackson 2
(JsonConverters, storing a kept run) and Spring's Jackson 3 both write
it unchanged. Exaflow writes results with pydantic model_dump_json,
which emits no bare NaN/Infinity, so the text is always valid JSON.

Breaking: result integers are no longer sent as doubles, and null
fields in results are sent as null instead of being omitted. The UI
reads both forms the same way (toFiniteNumber, first()).

Contract tests

Across a kept run's store-and-serve path:

  • the open side of a one-sided CI stays the string "Infinity";
  • a tiny p-value keeps its value;
  • null statistics stay present as null, and integers stay integers;
  • the paired x/y labels and alternative enums reach the UI as sent;
  • one-sided run parameters read from UI JSON reach Exaflow unchanged.

ExperimentDTOResultTest checks that a stored result is served with its
nulls (nested too) and integers; it fails on the old Gson path.
SpringJsonMapper (test) builds the mapper Spring MVC uses from
application.yml. PR #39 adds the identical file, so either merge order
is clean.

Merge notes

Tests

mvn test: 129 tests, 0 failures.

Exaflow PR #656 (algorithms/t-test-corrections) changes t-test values,
not their shape: one-sided bounds use t_{1-alpha}, p-values come from
the survival function (3.9e-235 instead of 0), a one-row group no
longer nulls the independent t-test, and the paired spec now labels x
"Measurement 1" and y "Measurement 2" (mean_diff = x - y).

The backend passes results and specifications through untouched, so
none of this needs backend code. These tests pin what that relies on,
across the Gson read -> Jackson write hop of a preview or saved run:
- the open side of a one-sided CI stays the string "Infinity";
- a tiny p-value keeps its value;
- null statistics stay present as null;
- the paired x/y labels and alternative enums reach the UI as sent;
- one-sided run parameters reach Exaflow unchanged.
…mapper

The t-test contract test serialized with a plain ObjectMapper, so it
missed application.yml's non_null inclusion. Through the real mapper,
null statistics are dropped from the response, not sent as null; the
UI reads a missing statistic the same as null. The test now asserts
that.

SpringJsonMapper builds the mapper Spring MVC uses from
application.yml. The result, specification and request tests go
through it. The one-sided request test now reads UI JSON instead of
serializing a Java Map it built itself.
@KFilippopolitis
KFilippopolitis force-pushed the feat/ttest-corrections-support branch from fec8a44 to dcf1c9c Compare October 28, 2026 12:04
@KFilippopolitis
KFilippopolitis changed the base branch from feat/pca-reporter-contract-alignment to master October 28, 2026 12:05
Results were parsed with Gson into Objects and written back with
Spring's Jackson. Gson turned every number into a double (n_obs 217
became 217.0), and application.yml's non_null inclusion dropped every
null inside the result, at any depth (a t-test p of null disappeared).

AnalysisService now returns a 200 body as RawJson, and ExperimentDTO
serves a stored result as RawJson. Both Jackson 2 (JsonConverters,
storing a kept run) and Spring's Jackson 3 write RawJson unchanged.
Exaflow writes results with pydantic model_dump_json, which emits no
bare NaN or Infinity, so the passed-through text is always valid JSON.

BREAKING CHANGE: result integers are no longer sent as doubles, and
null fields in results are sent as null instead of being omitted.
@KFilippopolitis KFilippopolitis changed the title test(algorithm): pin the Exaflow t-test contract of PR #656 fix(analysis)!: pass Exaflow results through unchanged and pin the t-test contract of PR #656 Oct 28, 2026
…ons-support

# Conflicts:
#	src/main/java/hbp/mip/algorithm/AnalysisService.java
@KFilippopolitis
KFilippopolitis marked this pull request as ready for review October 28, 2026 12:50
@KFilippopolitis
KFilippopolitis merged commit 6e25be2 into master Oct 28, 2026
0 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