Repository navigation
Vendor NNS-core from the R-fixes follow-up and drop the M.reg underflow guard - #169
Closed
gitRasheed wants to merge 4 commits into
Closed
gitRasheed wants to merge 4 commits into
gitRasheed wants to merge 4 commits into
Conversation
This was referenced Nov 2, 2026
gitRasheed
force-pushed
the
rasheed/mirror-regression-stack
branch
from
November 2, 2026 04:12
a324683 to
febf707
Compare
gitRasheed
force-pushed
the
rasheed/vendor-core
branch
from
November 2, 2026 04:12
d9ce7b3 to
84af909
Compare
Copy CMakeLists.txt, include/ and src/ from NNS-core's core-r-fixes-followup tip (the git objects match it verbatim) and record that commit as core_commit. Besides comment trims, the snapshot brings the core ports of the later R fixes: the pairwise SD test, NNS.seas scoring every component series, equal ARMA seasonal weights when they sum to zero, and Rmath's factorisation of dt in the M.reg kernels. NNS-python binds none of the SD or seasonality kernels, so their R mirrors stay in Python; the M.reg dt change is picked up in the next commit. Native and NNS_DISABLE_NATIVE=1 runs of the parity, invariant, property, plotting and docs tests give the same results.
_native_mreg_is_exact kept queries far outside the training ranges on the NumPy path, because NNS-core evaluated the Student-t weight as the closed form (1 + d^2/k)^(-(k+1)/2), which underflows differently from Rmath's dt. NNS-core now factors dt as Rmath does, so the native kernels follow R there as well and the guard goes. Far queries ([0.2, 0.5, 300], [5, -40, 0.3], [1e3, 0.5, 0.5]) on a 300-row RPM, dist NNS/L1/L2, k = 50 and 300 and the k <= 200 path: native vs R's NNS_mreg_predict_v2_cpp / _path_v2_cpp, max relative difference 3e-15. The gate test is replaced by this parity test (native only: the NumPy path differs from R by 1.2e-8 at one far L1 path entry, k = 167, through SciPy's t.pdf).
Copy CMakeLists.txt, include/ and src/ again from NNS-core's core-r-fixes-followup tip and record it as core_commit. The new tip only drops audit finding IDs from comments.
Copy CMakeLists.txt, include/ and src/ from NNS-core's core-r-fixes-followup tip and record it as core_commit. It brings mreg_predict dividing by the column range like R's reference helper, so native M.reg distance ties resolve like the NumPy fallback; the SD pair test centred on its midrange; NNS.seas constancy read from raw values with a stable CV order; single-mode averaging of equally high peaks; and parallel_for rethrowing worker exceptions on the calling thread. The two native/fallback tie checks that waited for this snapshot lose their strict xfails.
gitRasheed
force-pushed
the
rasheed/mirror-regression-stack
branch
from
November 2, 2026 23:09
febf707 to
bd3e248
Compare
gitRasheed
force-pushed
the
rasheed/vendor-core
branch
from
November 2, 2026 23:09
84af909 to
448c27a
Compare
Contributor
|
Incorporated through NNS R 14.0 integration #192, merged as |
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.
We vendor
extern/NNS-corefrom the tip of OVVO-Financial/NNS-core#34 and setcore_committo its full SHA. The snapshot brings the core ports of the later R fixes: the pairwise SD test, NNS.seas scoring every component series, equal ARMA seasonal weights when they sum to zero, and Rmath's factorisation ofdtin the M.reg kernels.Stacked on #168; merge with a merge commit.
Changes
CMakeLists.txt,include/andsrc/match that tip's git objects verbatim.dtdoes, so we drop_native_mreg_is_exactfrom Re-vendor NNS-core, bind its M.reg kernels and honour ncores #157 and far-off-range queries run native. On a 300-row RPM with dist NNS/L1/L2 and k = 50 and 300, native matches R'sNNS_mreg_predict_v2_cppand_path_v2_cppto 3e-15.Tests
The gate test is replaced by a native-only parity test against R's M.reg kernels, with new cache shards for both. The NumPy path differs from R by 1.2e-8 at one far L1 path entry (k = 167), through SciPy's
t.pdf; that predates this slice. Native andNNS_DISABLE_NATIVE=1runs of the parity, invariant, property, plotting and docs tests give the same results. The parity cache encodes R 13.3 plus the fixes in OVVO-Financial/NNS#73-#92.Vendors OVVO-Financial/NNS-core#34
Update
This push re-vendors NNS-core at
a0d3b93, the tip of OVVO-Financial/NNS-core#34. That adds the core mirrors of OVVO-Financial/NNS#102, #105 and #106, andparallel_fornow passes a worker's exception back to the caller instead of aborting the process. The two strict xfails from #157 come off: native and fallback both give 20 on the M.reg tie case and 9.441176 on the mode tie case.Review
GPT-6.1 Sol reviewed this slice and found nothing. It checked 168 M.reg cases and 56 vendored-kernel cases against live R; far queries match R to 1.85e-14.