Commit Graph
2 Commits
Author SHA1 Message Date
Dario Gabriel LipicarandClaude Opus 5 a80467bb18 test(doctests): move logos-lidl at the qt-sdk nodes, not under logos-cpp-sdk
The doc-tests failed to build logos-qt-generator:

  share/lidl-frontend/lidl_compat.h:46: error: 'paramValueType' has not been
  declared in 'lidl'

MECHANISM. This SDK installs cpp-generator/experimental/lidl_compat.h into
$out/share/lidl-frontend/, and logos-qt-sdk's logos-qt-generator *compiles*
that installed header against qt-sdk's OWN logos-lidl input. Under
logos-qt-sdk, logos-lidl is a SIBLING of logos-cpp-sdk, not a descendant:

  logos-qt-sdk
  |-- logos-cpp-sdk   <- --override-input moves this to the commit under test
  `-- logos-lidl      <- stays on qt-sdk's lock (8c95d4f), lacks the accessors

logos-logoscore-cli and logos-module-builder both declare
`logos-qt-sdk.inputs.logos-cpp-sdk.follows = "logos-cpp-sdk"` but no lidl
follows, so overriding the SDK hands qt-sdk a new lidl_compat.h next to its
old lidl. The failing derivation is logos-qt-generator — not anything in
logos-cpp-sdk, which is why the previous attempt aimed at the wrong node.

THE FIX is one `<path-to-logos-qt-sdk>/logos-lidl` override per qt-sdk node
that ends up on the SDK under test. A tree-walk over the resolved lock found
four in logoscore-cli's closure and two per module build; with the overrides
applied the walk reports zero remaining.

WHAT WAS REMOVED, and why it was doing nothing:

  * The `.../logos-cpp-sdk/logos-lidl` overrides added in bef3ef5 were no-ops.
    With only `--override-input logos-cpp-sdk <sha>`, that node's logos-lidl
    already resolves to 35f33d87 out of cpp-sdk's own lock — nix >= 2.26
    carries an overridden input's lock, and CI runs Determinate Nix. Verified
    by resolving the lock with and without them: byte-identical.
  * The `logos-module-client/...` overrides never matched anything. Nix says so
    out loud ("does not match any input"): logoscore-cli has no such root
    input; module-client only appears under logos-test-modules/, outside the
    runtime closure. The prose claiming it pins the SDK is corrected too.

cpp-sdk-concurrent-dispatch is fixed here as well — it failed the same way and
carried no lidl overrides at all.

VERIFIED locally against bef3ef5, the exact commit CI failed on:

  * accounts .lgx  -> exit 0, logos-accounts_module-module-lib.lgx (5,939,898 B)
  * logoscore CLI  -> exit 0, ./logos/bin/logoscore reports
                      "logos-cpp-sdk bef3ef57d3f489073672e70a786c550df7edd003"
  * negative control (same command minus the single qt-sdk lidl flag) fails
    with CI's exact derivation,
    /nix/store/pf96n2ldvhy6sq39ygkh5zdqx7dcn4df-logos-qt-generator-0.1.0.drv
  * no "does not match any input" warnings remain on any command

The durable fix is a one-line bump of logos-qt-sdk's own flake.lock logos-lidl
to master (logos-lidl#7 is purely additive: six new inline helpers, nothing
removed or renamed). Once qt-sdk carries it, every override added here can go.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 02:07:22 -03:00
Dario LipicarandClaude Opus 4.8 aea29d3797 Per-module concurrent dispatch: C++ module async export (#93)
* feat: emit logos_module_dispatch_async for concurrency:multi C++ modules

The cdylib C-ABI exports gain an async dispatch entry (each call run on a worker
thread, reply on completion) for universal + cdylib C++ modules. --concurrency
multi flag in logos-cpp-generator.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs: cpp-sdk concurrent-dispatch doctest (concurrency:"multi" showcase)

A concurrency:multi C++ worker + a single driver firing concurrent calls, showing
the multi worker overlaps them. The C++ cdylib generator needs NO change — its
logos_module_dispatch is already safe to call concurrently; the worker pool lives
in the Qt glue and the result is deferred via a sentinel + completion event.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix: wire universal-cdylib modules() independent of the context latch

A C++ interface:"universal" cdylib that calls another module via
modules().<dep>... segfaulted on its FIRST cross-module call: the typed
dependency surface (LogosModules) was wired inside lidlTryFireContext, which
returns early when no persistence context was stored (g_ctxStored == false).
When the daemon never delivers a context (observed: zero set_context calls for
a context-less module), maybeSetLogosModules never ran, m_logosModulesPtr
stayed null, and LogosModuleContext::modules() dereferenced null.

modules() does not need the context — each dependency client bakes its
target+origin at codegen time and creates its lp client lazily on first call.
So wire it in its own context-independent once-latch (lidlEnsureModulesWired),
called at the top of lidlTryFireContext before the context-gated early return,
i.e. on the first dispatch / set_context / set_emit_callback. A module with
deps but no stored context now has modules() wired before any handler runs.
(Bump the concurrent-dispatch doctest's post-daemon-start sleep 3 -> 6 to match
the rust spec's cold-start margin.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test: green the universal-cdylib concurrent-dispatch doctest + wire into CI

The driver/worker split a declarations-only impl header (so the cpp-generator's
--header-to-lidl doesn't choke on inline std calls) from the impl body. That
body was never compiled — metadata's nix.cmake.extra_sources is parsed but not
consumed by the LogosModule.cmake the build actually uses — so the impl symbols
(FanoutDriverModuleImpl::fanOut / ::peak) were UNDEFINED in the dylib and the
plugin null-jumped (bl -> 0x0) on the first cross-module call. Pass the impl
.cpp via logos_module()'s existing SOURCES argument so it's compiled and linked.

With this the cpp universal-cdylib reaches worker peak overlap 4 end-to-end (a
single-threaded driver fans out 4 async calls into a concurrency:"multi" worker
and all four overlap), matching the Rust half. Wire the spec into doctests.yml
so the workspace pipeline runs it.

(Auto-wiring metadata.extra_sources — so the split pattern works without listing
SOURCES by hand — needs the consumer added to the backend LogosModule.cmake
copies in logos-plugin-core / logos-plugin-qt; tracked separately.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore: bump logos-protocol to merged master (protocol#5)

  logos-protocol  9de4165 → 4ea32a3  (concurrent-dispatch handshake coalescing, now on master)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 16:31:45 -03:00