Skip to content

build: enhance Cargo profiles (release-with-debug + neuromod alignment) + service registry unit tests #30

Description

@rmems

Summary

Enhance the existing Cargo profiles for better consistency with other Limen-Neural crates (especially neuromod) and lock down unit-test coverage for the service registry’s enable/disable and empty-registry paths on the stub backend.

Cargo profiles

The four built-in profiles are already present in Cargo.toml and documented in the README, but they are intentionally conservative. This issue formalizes a small, deliberate enhancement:

Current state

  • [profile.dev] – opt-level 0, full debug, overflow checks
  • [profile.release] – opt-level 3, thin LTO, strip debuginfo
  • [profile.test] – matches dev (debuggable + safe)
  • [profile.bench] – matches release

Proposed changes

  1. Add custom profile (matches neuromod pattern and is useful for a 1 kHz tick-loop daemon):

    [profile.release-with-debug]
    inherits = "release"
    debug = true

    Use with cargo build --profile release-with-debug when you need symbols for perf / flamegraphs / tracing without falling back to a full debug build.

  2. Optional tightenings (discuss / apply only if compile-time cost is acceptable):

    • [profile.release]: lto = true (or keep "thin") + codegen-units = 1
    • [profile.dev]: opt-level = 1 + incremental = true (faster local runs of the daemon)
    • [profile.bench]: inherits = "release"
  3. Update the README “Cargo profiles” table and the comment block in Cargo.toml so the intent stays explicit.

Keep the conservative philosophy: no extreme knobs that over-promise for a headless inference daemon.

Service registry unit tests

(Original intent preserved)

Registry is config-driven ([[services]] in daemon.toml). Coverage stays on the stub backend path.

  1. Locate registry construction / enable flags in src/registry.rs (or equivalent).
  2. Unit tests for:
    • empty services list
    • enabled service present
    • disabled service not active
  3. Keep tests free of network / ZMQ.

Acceptance criteria

  • [profile.release-with-debug] added and documented
  • README + Cargo.toml comments updated to reflect final profile choices
  • cargo build, cargo build --release, cargo test, and cargo build --profile release-with-debug all succeed
  • New unit tests cover enable/disable + empty-registry paths
  • cargo test green without optional features
  • No new dependencies without justification
  • Assignee: @rmems

Relationships

Out of scope

  • Real service adapter implementations
  • Cross-repo IPC integration
  • Aggressive “max-opt / inferno” profiles or FPGA-specific profiles (future issues)

Metadata

Metadata

Assignees

Labels

readyReady to implementsize:SSmall: ~1 PR, hours not daystesting

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions