Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions sync/last_live_r_parity_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
- Plan: `sync/last_r_api_plan.json`
- R checkout: `upstream/NNS`
- Fresh cache requested: `False`
- Skip install: `False`
- Live R recompute: `True`
- Skip install: `True`
- Live R recompute: `False`

## Result: live R parity diverged
## Result: manual review required

Mapped parity tests recomputed every R value from the freshly installed live R NNS and the Python implementation did not match. Public Python behavior differs from live R at the recorded commit.
The plan reports unmapped R files. A human must extend `sync/r_api_map.json` before automated parity can run:

Failing command: `/opt/hostedtoolcache/Python/3.11.15/x64/bin/python -m pytest -q -n 0 tests/parity/test_practical_examples.py tests/parity/test_r13_smoke.py`
Exit status: `1`
- `R/Multivariate_Regression.R`
- `R/Partition_Map.R`
- `R/RcppExports.R`
- `R/gvload.R`

## Workflow step outcome

- `run_live_r_parity_for_changed_api.py` step outcome: `failure`
- Fresh cache requested: `false`
- DESCRIPTION changed: `true`
68 changes: 60 additions & 8 deletions sync/last_r_api_inspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,77 @@

## Changed files

- `R/ARMA.R`
- `DESCRIPTION`
- `NAMESPACE`
- `NNS_13.1.tar.gz`
- `NNS_13.1.zip`
- `R/Multivariate_Regression.R`
- `R/Partition_Map.R`
- `R/RcppExports.R`
- `R/Regression.R`
- `R/Stack.R`
- `R/gvload.R`
- `doc/NNSvignette_01_Overview.R`
- `doc/NNSvignette_01_Overview.Rmd`
- `doc/NNSvignette_01_Overview.html`
- `doc/NNSvignette_03_Correlation_and_Dependence.html`
- `doc/NNSvignette_07_Clustering_and_Regression.R`
- `doc/NNSvignette_07_Clustering_and_Regression.Rmd`
- `doc/NNSvignette_07_Clustering_and_Regression.html`
- `doc/NNSvignette_08_Classification.R`
- `doc/NNSvignette_08_Classification.Rmd`
- `doc/NNSvignette_08_Classification.html`
- `doc/NNSvignette_09_Forecasting.html`
- `man/NNS.boost.Rd`
- `man/NNS.part.Rd`
- `man/NNS.stack.Rd`
- `src/NNS.dll`
- `src/RcppExports.cpp`
- `tests/testthat/Rplots.pdf`
- `vignettes/NNSvignette_01_Overview.R`
- `vignettes/NNSvignette_01_Overview.Rmd`
- `vignettes/NNSvignette_01_Overview.html`
- `vignettes/NNSvignette_03_Correlation_and_Dependence.html`
- `vignettes/NNSvignette_07_Clustering_and_Regression.R`
- `vignettes/NNSvignette_07_Clustering_and_Regression.Rmd`
- `vignettes/NNSvignette_07_Clustering_and_Regression.html`
- `vignettes/NNSvignette_08_Classification.R`
- `vignettes/NNSvignette_08_Classification.Rmd`
- `vignettes/NNSvignette_08_Classification.html`
- `vignettes/NNSvignette_09_Forecasting.html`

## Affected Python modules

- `src/nns/arma.py`
- `pyproject.toml`
- `src/nns/__init__.py`
- `src/nns/multivariate_regression.py`
- `src/nns/regression.py`
- `src/nns/stack.py`
- `tests/_r_cache.json`
- `tools/NNS`

## Parity tests to run

- `tests/docs/test_vignette_examples.py`
- `tests/parity`
- `tests/parity/test_practical_examples.py`
- `tests/parity/test_r13_smoke.py`

## Cache scope

- `NNS.ARMA`
- `NNS.ARMA.optim`
- `NNS.VAR`
- `NNS.M.reg`
- `NNS.reg`
- `NNS.stack`

## Required actions

- Fresh cache required: `False`
- Export review required: `False`
- Unmapped R files present: `False`
- Fresh cache required: `True`
- Export review required: `True`
- Unmapped R files present: `True`

## Unmapped R files

- `R/Multivariate_Regression.R`
- `R/Partition_Map.R`
- `R/RcppExports.R`
- `R/gvload.R`
68 changes: 59 additions & 9 deletions sync/last_r_api_plan.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,72 @@
{
"changed_files": [
"R/ARMA.R"
"DESCRIPTION",
"NAMESPACE",
"NNS_13.1.tar.gz",
"NNS_13.1.zip",
"R/Multivariate_Regression.R",
"R/Partition_Map.R",
"R/RcppExports.R",
"R/Regression.R",
"R/Stack.R",
"R/gvload.R",
"doc/NNSvignette_01_Overview.R",
"doc/NNSvignette_01_Overview.Rmd",
"doc/NNSvignette_01_Overview.html",
"doc/NNSvignette_03_Correlation_and_Dependence.html",
"doc/NNSvignette_07_Clustering_and_Regression.R",
"doc/NNSvignette_07_Clustering_and_Regression.Rmd",
"doc/NNSvignette_07_Clustering_and_Regression.html",
"doc/NNSvignette_08_Classification.R",
"doc/NNSvignette_08_Classification.Rmd",
"doc/NNSvignette_08_Classification.html",
"doc/NNSvignette_09_Forecasting.html",
"man/NNS.boost.Rd",
"man/NNS.part.Rd",
"man/NNS.stack.Rd",
"src/NNS.dll",
"src/RcppExports.cpp",
"tests/testthat/Rplots.pdf",
"vignettes/NNSvignette_01_Overview.R",
"vignettes/NNSvignette_01_Overview.Rmd",
"vignettes/NNSvignette_01_Overview.html",
"vignettes/NNSvignette_03_Correlation_and_Dependence.html",
"vignettes/NNSvignette_07_Clustering_and_Regression.R",
"vignettes/NNSvignette_07_Clustering_and_Regression.Rmd",
"vignettes/NNSvignette_07_Clustering_and_Regression.html",
"vignettes/NNSvignette_08_Classification.R",
"vignettes/NNSvignette_08_Classification.Rmd",
"vignettes/NNSvignette_08_Classification.html",
"vignettes/NNSvignette_09_Forecasting.html"
],
"affected_python_modules": [
"src/nns/arma.py"
"pyproject.toml",
"src/nns/__init__.py",
"src/nns/multivariate_regression.py",
"src/nns/regression.py",
"src/nns/stack.py",
"tests/_r_cache.json",
"tools/NNS"
],
"parity_tests": [
"tests/docs/test_vignette_examples.py",
"tests/parity",
"tests/parity/test_practical_examples.py",
"tests/parity/test_r13_smoke.py"
],
"cache_scope": [
"NNS.ARMA",
"NNS.ARMA.optim",
"NNS.VAR"
"NNS.M.reg",
"NNS.reg",
"NNS.stack"
],
"requires_fresh_cache": true,
"requires_export_review": true,
"has_unmapped_r_files": true,
"unmapped_r_files": [
"R/Multivariate_Regression.R",
"R/Partition_Map.R",
"R/RcppExports.R",
"R/gvload.R"
],
"requires_fresh_cache": false,
"requires_export_review": false,
"has_unmapped_r_files": false,
"unmapped_r_files": [],
"warnings": []
}
8 changes: 4 additions & 4 deletions sync/nns_source.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"r_repo": "OVVO-Financial/NNS",
"r_commit": "905b8bbd42b3236bf88aba7f18df7a9a378dbd7b",
"r_version": "13.0",
"r_src_tree_hash": "654e411bd4e8caabfd57a1a4190eb1d97411e059",
"r_commit": "c13fb4f8162ba97559f87de03db0a3de34317ec6",
"r_version": "13.1",
"r_src_tree_hash": "a234d44e5a0366884efe58c5441ce18d413ec215",
"core_repo": "OVVO-Financial/NNS-core",
"core_commit": "cfc25a3469df6460f9224fb976fcb58de9d58068",
"python_repo": "OVVO-Financial/NNS-python",
"python_commit": null,
"vendored_core_path": "extern/NNS-core",
"vendored_r_path": "tools/NNS",
"vendored_r_tarball": "tools/NNS_13.0.tar.gz",
"vendored_r_tarball": "tools/NNS_13.1.tar.gz",
"r_cache_path": "tests/_r_cache.json",
"notes": "NNS-python consumes accepted NNS-core snapshots for native code and verifies public Python behavior against live or cached R NNS."
}
6 changes: 6 additions & 0 deletions tools/NNS/.Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
^.*\.Rproj$
^\.Rproj\.user$
^\.travis\.yml$
^doc$
^Meta$
^\.github/
73 changes: 73 additions & 0 deletions tools/NNS/.github/downstream-sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Downstream sync contract

`OVVO-Financial/NNS` is the source of truth for the NNS implementation. It is
the truth for **both** the native C++ layer under `src/**` and the R API
behavior under `R/**`, `NAMESPACE`, and `DESCRIPTION`.

Downstream flow (a diamond, not a single chain):

```text
OVVO-Financial/NNS (source of truth: R + C++ src/**)
/ \
src/** native truth R API behavior truth
v v
NNS-core (portable C++) (tested directly)
\ |
v v
NNS-python <-------------+
```

Two paths converge on `NNS-python`:

* **Native path:** `src/**` is the native C++ truth. It flows to `NNS-core`
(the portable C++ layer), which in turn feeds `NNS-python`.
* **API path:** `R/**`, `NAMESPACE`, and `DESCRIPTION` define the R API
behavior truth, which is tested directly and flows straight to `NNS-python`
for API and parity review.

`NNS-python` sits at the convergence of both paths and must satisfy both.

## Triggers

A push to `NNS-Beta-Version` dispatches downstream sync events based on changed files.

| Changed path | Downstream action |
| ------------- | ----------------------------------------------------------------------------- |
| `src/**` | Dispatch `nns-r-src-updated` to `OVVO-Financial/NNS-core` |
| `R/**` | Dispatch `nns-r-api-or-version-updated` to `OVVO-Financial/NNS-python` |
| `NAMESPACE` | Dispatch `nns-r-api-or-version-updated` to `OVVO-Financial/NNS-python` |
| `DESCRIPTION` | Dispatch `nns-r-api-or-version-updated` and require downstream version review |

A `DESCRIPTION` version change means downstream Python must perform fresh live-R parity-cache regeneration.

## Required secret

`OVVO_SYNC_TOKEN` must be a token or GitHub App installation token with permission to call `repository_dispatch` on:

* `OVVO-Financial/NNS-core`
* `OVVO-Financial/NNS-python`

The default `GITHUB_TOKEN` is intentionally not used for cross-repo dispatch, because it is scoped to this repository and cannot reliably trigger `repository_dispatch` on the downstream repositories.

## Payload

Dispatch payloads include:

* `r_repo`
* `r_commit`
* `r_ref`
* `r_version`
* `r_src_tree_hash`
* `src_changed`
* `r_api_changed`
* `description_changed`
* `changed_files`

## Expected downstream events

* `nns-r-src-updated` — received by `OVVO-Financial/NNS-core` when `src/**` changes.
* `nns-r-api-or-version-updated` — received by `OVVO-Financial/NNS-python` when `R/**`, `NAMESPACE`, or `DESCRIPTION` changes.

## Rule

No downstream sync is complete until each downstream repository records the exact upstream R commit and verifies its own build and parity gates.
Loading
Loading