Skip to content
Draft
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
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,32 @@ jobs:
python scripts/smoke_python_bindings.py
python scripts/smoke_python_integration.py external/dag-ml-data

r-bindings:
name: R bindings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: r-lib/actions/setup-r@v2
- name: Install R dependencies
run: Rscript -e 'install.packages("jsonlite", repos = "https://cloud.r-project.org")'
- name: Build R source package
run: |
mkdir -p target/r
cd target/r
R CMD build ../../bindings/r
- name: Check R source package
run: R CMD check --no-manual target/r/dagml_*.tar.gz

matlab-octave-bindings:
name: MATLAB/Octave bindings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install GNU Octave
run: sudo apt-get update && sudo apt-get install --yes octave
- name: Test local implementation registry
run: octave --no-gui --quiet --eval "addpath('bindings/matlab/tests'); local_implementation_registry"

wasm-bindings:
name: WASM bindings Node ${{ matrix.node-version }}
needs: contract-lockstep
Expand Down
397 changes: 397 additions & 0 deletions bindings/matlab/+dagml/LocalImplementationRegistry.m

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions bindings/matlab/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# DAG-ML MATLAB/Octave binding

`dagml.LocalImplementationRegistry` is the MATLAB-owned process-local
implementation registry. It retains loss and metric `function_handle` objects
under exact DAG-ML descriptors; executable objects are never written into DAG
JSON contracts.

```matlab
implementations = dagml.LocalImplementationRegistry();
implementations.registerLoss(lossReference, @asymmetricLoss);

[value, attestation] = implementations.invokeTrainingLoss( ...
nodeTask, 1, yTrue, yPred);
result.lineage.loss_attestations = {attestation};
```

`invokeTrainingLoss` accepts only `FIT_CV` and `REFIT`. It validates the active
role against `NodeTask.required_loss_attestations`, executes the local function,
and returns the native-produced attestation only after successful execution.
Each MATLAB process, parallel worker, Octave process, or replay process must
register its own local functions.

Run the binding test with GNU Octave:

```bash
octave --no-gui --quiet --eval \
"addpath('bindings/matlab/tests'); local_implementation_registry"
```
Loading