Repository navigation
fix(lane D): mask NaN and padding in every lane D forecast (owner 2026-12-01) - #1060
Merged
Merged
Conversation
…6-12-01) Owner: "it's meant to mask NaN". Lane D now masks missing history values instead of refusing or cutting them, the same for every entry: - lane_d_scorer (live + public judging, `cascade lane-d test`, T7, env-qual): a non-finite history point is filled with 0.0 and marked unobserved in the point mask the pyramid already takes for the horizon (scaler + model mask), via observed_rows -> pad_mask.observed_context (the bench / lane A / lane B rule). All-finite inputs are bit-identical. A window with nothing observed is refused before load. - lane_d_public.build_window: a kept window carries its whole history (NaN included) instead of its finite suffix. The drop decisions and the MASE scale still read the finite suffix (public.dropped and the judged set are unchanged). Cut cache schema -> lane-d-public-cut/2. - lane_d_bench_sweep: materialised dirs get the release's canonical model.py / forecast_wrapper.py; the sidecar pass pins --bench-method observed_mask/3 (ObservedMaskWrapper); a report of another method fails the sweep. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
A torch (CI-only) test pins that the lane D scorer's NaN masking is the pad_mask.py observed-mask rule, not a new one: on a full-context history with NaN (nothing to pad) its forecast equals ObservedMaskWrapper around the byte-pinned wrapper (the sidecar's observed_mask/3 path). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe
…seam first (fail on base by assertion) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe
…irst (fails on base by assertion) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Owner, 2026-12-01: "it's meant to mask NaN". With this PR, every lane D forecast masks missing history values and padding instead of refusing them or cutting them away. The rule is the same for every entry (king, house and challengers).
Where the mask is built and how it reaches cascade_pyramid
cascade lane-d test, T7, env-qual. All of these go throughcascade/eval/lane_d_scorer.py::forecast_quantiles. That function uses only the repo'spyramid_model: it never imports a file from the checkpoint and it never pads. The newobserved_rows()appliespad_mask.observed_context, the same GluonTS rule the bench and lanes A/B use. A NaN or inf point becomes 0.0 and is unobserved, and a patch that is more than half missing is unobserved as a whole._forwardconcatenates~observedwith the horizon mask, so the mask goes intocausal_standardizeand intomodel(z, mask=...). An all-finite input gives the same mask as before, so its output is bit-identical. A window with no finite point in its model input is refused before load with aValueError. This is the existing rule, like a history shorter than one patch.lane_d_public.build_window). Before, the history was cut to the longest all-finite suffix. Now a kept window carries its whole history before the cut, with its NaN left in (leading columns with no finite value are trimmed). The drop decisions are byte-identical: they still read the finite suffix, sopublic.dropped, the reasons and the judged set that the checker re-derives do not change. The MASE scale is unchanged too, because it is still computed on the finite suffix (scale_history).CUT_SCHEMAmoves tolane-d-public-cut/2.lane_d_bench_sweepdid not pass a method, so the sidecar fell back to its default ($CASCADE_BENCH_METHOD, elseobserved_mask/3). That default wraps the checkpoint'sforecast_wrapper.Wrapperinpad_mask.ObservedMaskWrapper: NaN and left padding become 0.0 and unobserved, and fully padded patches are never attention keys. The wrapper's own refusal of non-finite values and itsrow[0]edge-pad were therefore bypassed. A host env set toimpute/0would have silently switched this to forward-fill plus edge-pad.--bench-method observed_mask/3. A report stamped with any other method fails the sweep withsweep_failed(the gate holds).Canonical wrapper decision
W4 ingest (
code_mismatch) already admits only the release's exactmodel.py/forecast_wrapper.pybytes, and the live scorer loads no checkpoint file. Editingpyramid_wrapper.pywould make every existing entry fail ingest. It would also change lane A's pinned checkpoint code. So the wrapper file is not edited, and the mask is applied from outside, as lanes A and B already do.materialisenow writes the release's canonical code (canonical_code()) into each bench dir instead of copying the entry's copies, so the rule does not depend on when an entry was admitted.Why the scorer does not wrap the checkpoint in ObservedMaskWrapper itself
The bench sidecar's
observed_mask/3(observed.py→pad_mask.ObservedMaskWrapper) already masks NaN and leading padding for lane D gate/king-bench checkpoints, so those numbers were already masked; this PR pins it. The live/public scorer uses the SAME rule but not the class:ObservedMaskWrapperneeds the checkpoint'sforecast_wrapper.pyimported (the scorer is repo-code-only by design) and left-pads every history tocfg.context_length(up to 131072 for declared contexts), which breaks the no-pad batch plan and the T7 4k == declared-128k identity. The scorer therefore calls the wrapper's own mask builder (pad_mask.observed_context) and the same_parametersarithmetic (cat(~observed, horizon)intocausal_standardizeandmodel(mask=)); with no padding the leading-pad key rule is inert. A CI torch test (test_the_scorer_masks_exactly_as_the_shared_observed_mask_wrapper) pins scorer ==ObservedMaskWrapper(pinned Wrapper)on a NaN full-context history.Live pool
pool_dlinearly interpolates history gaps at build time (_cut/_extend_back, max 20% missing). Live histories therefore reach the scorer finite, and the mask is a no-op for them. Changing that would change the snapshot bytes that auditors re-derive, so it is left as an owner decision.Consensus
Satellites and
cascade/audit/lane_d.py(checked on 86b3dba and 890fe6d) replay the signed rows. They never re-forecast and never rebuild windows:forecast_quantiles,build_windowand_finite_suffixare not referenced. For public data drops, the checker reads them as given and re-derives only the keep set. The signed report format is unchanged. From the deploy settlement on, scores shift for every entry alike: this affects public windows that have gaps, and bench items whose series hold NaN or are short. The PR applies cleanly ontovalidator-release-laned-1201c(86b3dba);merge-treereports no conflicts.Tests
Every new test fails on base by assertion. The torch tests are marked
torchand run in CI only.w5d/test_w5d_nan_mask.py: mask construction; NaN masked, not refused; all-NaN refused; [torch] the mask reaches the model call; [torch] NaN and inf give the same forecast and a masked point differs from an observed 0.0.w5k: a kept window holds its whole history; drops and MASE are unchanged. The old test expecting the suffix-only history is corrected.w8c: cut schema /2; NaN histories round-trip.w3b6a/test_w3b6a_masked_bench.py: canonical code is materialised; the masked method is pinned even when env saysimpute/0; a foreign-method report fails the sweep.🤖 Generated with Claude Code
https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe