Skip to content

Expose SyntaxInterface bridge APIs for jaspSyntax - #6221

Merged
boutinb merged 8 commits into
jasp-stats:developmentfrom
FBartos:bridge/syntaxinterface-jasp-syntax-api
May 15, 2026
Merged

Expose SyntaxInterface bridge APIs for jaspSyntax#6221
boutinb merged 8 commits into
jasp-stats:developmentfrom
FBartos:bridge/syntaxinterface-jasp-syntax-api

Conversation

@FBartos

@FBartos FBartos commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose status-returning SyntaxInterface APIs for .jasp option/dataset load, bridge lifecycle reset, dataset callbacks, and column decoding
  • make .jasp dataset loading file-backed and status-observable while preserving the existing void compatibility exports
  • reuse the shared DataBridge/DataSetProvider path for the native bridge and update CMake wiring for SyntaxInterface consumers
  • update the jaspBase submodule pointer to the runtime support commit used by the bridge

Why

jaspSyntax bundles/links against SyntaxInterface, so the Desktop source needs to expose the same ABI and native behavior that jaspSyntax and jaspTools now rely on for local replay. This PR keeps those semantics in Desktop/SyntaxInterface instead of reimplementing them in jaspTools.

Base branch

This targets development because jasp-stats/jasp-desktop does not currently expose master or main; development is the upstream default branch.

Related PRs

Verification

  • rebased onto current upstream/development
  • git diff --check HEAD~1..HEAD
  • native compile not run in this pass

@FBartos

FBartos commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

Senior follow-up pass pushed in 4eca8fe4e.

This fixes the native issues found while validating the jaspTools -> jaspSyntax replay bridge against real module archives:

  • QGuiApplication now receives process-lifetime argument storage instead of pointers derived from local temporaries. This fixes the hard crash seen when loading a direct data frame and then parsing variable-list QML.
  • .jasp archive loading now goes through provider->loadDatabase(jaspVersion). That preserves the archive version during DB load so older typed-column archives, such as jaspMixedModels/examples/Larks and Owls.jasp, are read with the correct pre-upgrade schema instead of trying to select non-existent Column_1 fields.

Verification run locally:

  • Rebuilt SyntaxInterface successfully with Ninja.
  • Direct in-process jaspSyntax read of Larks and Owls.jasp returns 260 x 9 with expected names.
  • Public installed jaspSyntax::readDatasetFromJaspFile() subprocess read also returns 260 x 9.
  • End-to-end jaspTools::runAnalysis(MixedModelsGLMM, dataset, opts) completes with status = complete on the patched stack.

Remaining note: native teardown still emits noisy QML/stack-imbalance/QThreadStorage warnings in some focused tests. They are not blocking replay now, but they are real lifecycle debt worth tracking separately from this bridge contract.

Related PRs for the full bridge:

@FBartos

FBartos commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up on the noisy focused-test output:

  • The GridLayout QML warning was not a module layout issue. In the headless/minimal SyntaxInterface path the layout check can run during cleanup/re-entry with a non-positive or non-finite width, while implicitWidth is still populated. I guarded _checkColumns() for non-positive/non-finite dimensions.
  • The QThreadStorage message was a real lifecycle issue. syntaxBridgeCleanup() is a reusable state reset and should stay that way, but the bridge also needed a terminal shutdown path that deletes the QQmlEngine, owned QGuiApplication, encoder, and data-provider state. Added syntaxBridgeShutdown() for package unload/session exit.
  • The stack-imbalance warning was not a MixedModels warning. It came from SyntaxInterface parse-only startup bootstrapping more of the R bridge than it needed. Desktop now keeps jaspBase lazy for the uncommon QML-R-script path, and rbridge_init(..., insideJasp=false) skips the Engine-only friendly R helper bundle while still exposing the native dataset/callback bridge.

Validation with a fresh jaspSyntax install using the rebuilt Desktop bridge:

  • ninja -C C:/JASP-Packages/jasp-desktop/build SyntaxInterface
  • test-module-options.R: 49 pass
  • test-dataset-helpers.R: 85 pass
  • full jaspSyntax/tests/testthat: 256 pass, 1 skip
  • real jaspMixedModels QML parse for MixedModelsGLMM: 76 options returned

The warning scans for those runs were clean for GridLayout, qml:, QThreadStorage, QObject, Timers cannot, stack imbalance, eager jaspBase init, and friendly-R-helper loading.

@boutinb
boutinb merged commit f4e5f3e into jasp-stats:development May 15, 2026
2 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.

3 participants