Skip to content

v0.3.1-alpha.1: Stabilization + Oracle B-O1/B-O2 + Full Medium/High completion - #11

Merged
InitusNovus merged 82 commits into
mainfrom
dev
Mar 13, 2026
Merged

v0.3.1-alpha.1: Stabilization + Oracle B-O1/B-O2 + Full Medium/High completion#11
InitusNovus merged 82 commits into
mainfrom
dev

Conversation

@InitusNovus

Copy link
Copy Markdown
Owner

Summary

This PR merges 80 commits from dev into main, representing the stabilization pause checkpoint for version 0.3.1-alpha.1. It completes all Critical, High, Medium, and select Low ROADMAP items, plus two Oracle hardening milestones (B-O1, B-O2).

Scope: This is an internal alpha pre-release. The actual v0.3.1 release tag will be applied to main after PR review and merge.


Highlights by Category

🔮 Oracle Hardening (B-O1, B-O2)

  • B-O1: Full Oracle corpus integration test suite — 91,623 total test cases, 99.25% adjusted pass rate, 0 skipped
  • B-O2: Mux per-branch vector generation in engine.py; added mux-specific unit tests; catalogued 1,778 Category-C exceptions in CATEGORY_C_EXCEPTIONS.md
  • Residual tech debt cleaned: removed unused db parameter from _generate_mux_vectors(); added B-O3 TODO

🏗️ Core F# Library

  • All Critical (C-1, C-2) and High (H-1, H-2, H-3) items complete
  • All Medium (M-1 through M-4) items complete
  • Low item L-4 complete

📦 Version Bump

  • Signal.CANdy.Core.fsproj, Signal.CANdy.fsproj, Api.fs all updated to 0.3.1-alpha.1
  • Public-facing README install examples remain at 0.3.0 (alpha not exposed to end users)

📚 Documentation & History

  • Comprehensive session reports migrated into Reports/ (append-only historical record)
  • ROADMAP fully updated with all completed checkboxes
  • ORACLE_RESULTS.md and CATEGORY_C_EXCEPTIONS.md maintained as immutable evidence

Oracle Corpus Results

Metric Value
Total test cases 91,623
Adjusted pass rate 99.25%
Category-C failures 1,778
Skipped 0

Category-C failures are documented exceptions (edge cases in DBC files, not generator bugs) — see tests/oracle/CATEGORY_C_EXCEPTIONS.md.


Test Status

dotnet test (Release)

  • Signal.CANdy.Core.Tests: 73 passed, 0 failed ✅
  • Generator.Tests: 27 passed, 0 failed ✅
  • Total: 100 passed, 0 failed ✅

Python pytest (Oracle — local only, not in CI)

  • 41 passed, 0 failed ✅

dotnet build

  • 0 warnings, 0 errors

CI (GitHub Actions — build-test job)

  • All steps passed: F# tests, codegen, C build, C++ compat, smoke test, NuGet pack ✅
  • Note: lint job fails on Fantomas — this is a pre-existing issue in Codegen.fs, Dbc.fs, CodegenTests.fs, DbcTests.fs that predates this PR. Our changed file (Api.fs) passes Fantomas cleanly.

Version Note

  • This PR introduces 0.3.1-alpha.1 — an internal alpha for validation before the actual v0.3.1 release
  • After merge: apply v0.3.1 tag on main for the real NuGet release
  • NuGet README install examples will be updated at that point

Remaining Backlog (out of scope for this PR)

  • B-O3: Pure extended-mux message support (very rare in practice; tracked via TODO comment)
  • L-1, L-2, L-3: Low-priority feature improvements
  • Fantomas: Fix pre-existing formatting in Codegen.fs, Dbc.fs, CodegenTests.fs, DbcTests.fs

Commit Count

80 commits ahead of main. See git log --oneline origin/main..HEAD for full history.

InitusNovus and others added 30 commits February 12, 2026 12:53
- Remove 5 exception-swallowing try/with blocks in Dbc.fs that silently
  returned defaults on parse failures, risking incorrect C code generation
- Add GenerateError DU to preserve error type info through the pipeline
  (ParseError/ValidationError/CodeGenError no longer flattened to string)
- Update Api.fs, Library.fs facade, and CLI to match GenerateError variants
- Add Core test project with 13 tests (10 Dbc + 3 Api error propagation)
- Fix Windows test compatibility: use mingw32-make and .exe extension
- All 29 tests pass (16 Generator + 13 Core), 0 failures
- ConfigTests: 16 tests for Config.validate and Config.loadFromYaml

- CodegenTests: 8 tests for Codegen.generate with inline IR

- EdgeCaseTests: 4 tests for empty DBC, Motorola LSB, signed, 64-bit signals

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <[email protected]>
- FacadeTests: 4 tests verifying exception type mapping

- ApiTests: 1 E2E happy-path test with examples/sample.dbc

- fsproj: add compile items and Signal.CANdy project reference

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <[email protected]>
- Mark H-1c~H-1g, H-3a~H-3c as complete in ROADMAP

- Add session report for 34 new tests (63 total, 0 failures)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <[email protected]>
Remove 8 duplicated .fs files from Generator (~1100 lines), replacing them
with an 83-line Compat.fs backward-compatibility bridge that re-exports Core
types under the Generator namespace. Generator.fsproj now references Core
directly and carries zero package dependencies of its own.

Key changes:
- Generator.fsproj: remove 7 Compile items + 5 PackageReferences, add Core ref
- Compat.fs: bridge modules for Ir, Config, Dbc, Codegen, Result (active pattern)
- Program.fs: rewritten to use Core API (Config/Dbc/Codegen/Errors) directly
- Core Dbc.fs: add missing validateMuxStructure (was in legacy Generator only)

All 63 tests pass (47 Core + 16 Generator), E2E roundtrip verified.
- Fix get_bits_le/set_bits_le: replace hardcoded 8-byte loop with dynamic n_bytes
- Fix 64-bit mask UB: use UINT64_MAX when length==64
- Fix memset: use message.Length instead of hardcoded 8
- Add 6 F# tests (codegen + edge cases) for CAN FD payloads up to 64 bytes
- Add canfd_test.dbc (DLC=64, 3 signals) and E2E test_fd_roundtrip in main.c
- Update README: supported features + limitations reflect CAN FD support
- get_bits_be/set_bits_be already use dynamic bit-by-bit loops, no change needed
…ode (L-4c)

- Add canfd_dlc_to_len() / canfd_len_to_dlc() to generated utils (ISO 11898-1)
- Fix signed signal decode: cast uint64_t to int64_t before float conversion
  to prevent negative values from being interpreted as huge positive numbers
- Add comprehensive_test.dbc with 18 signals covering LE/BE, signed, packed,
  non-aligned, and scale/offset configurations
- Add 7 C E2E test functions verifying byte-level encode/decode correctness
- Add 5 F# unit tests for DLC mapping codegen and signal pattern generation
Sisyphus: 🪨⬆️ (OpenCode)
Sisyphus: 🪨⬆️ (OpenCode)
Sisyphus: 🪨⬆️ (OpenCode)
…ript)

- Add .config/dotnet-tools.json with ReportGenerator 5.4.5 local tool manifest
- Add run-coverage.ps1 PowerShell script for HTML coverage report generation
- Add TestResults/ and coverage_report/ to .gitignore

Sisyphus: 🪨⬆️ (OpenCode)
…ated vectors

- Add TRACE printf lines to test_roundtrip and test_fixed_roundtrip for visual verification
- Expand motorola_lsb_suite.dbc from 1 to 4 signals (3 unsigned + 1 signed, byte-aligned)
- Add test_moto_lsb_comprehensive with mathematically derived known_data byte arrays

Sisyphus: 🪨⬆️ (OpenCode)
- Add runCGeneratorWithDbc helper to support arbitrary DBC file paths
- Add 11 new [Fact] integration tests covering LE/BE/signed/nonalign/packed/scale,
  CAN FD, multiplex, value table, and Motorola LSB byte-level verification
- Generator test count: 16 -> 27, total: 74 -> 85

Sisyphus: 🪨⬆️ (OpenCode)
InitusNovus and others added 25 commits March 12, 2026 14:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Stabilization checkpoint for v0.3.1-alpha.1, adding a full oracle-based cross-validation pipeline (cantools ↔ generated C), hardening core parsing/codegen for corpus edge cases (mux, byte order, CAN FD, range sentinels), and updating versioning + project documentation/history.

Changes:

  • Added a Python oracle harness (CLI + matrix + corpus runners), oracle C harness template, and pytest coverage to validate generated C encode/decode against cantools.
  • Hardened F# DBC parsing and codegen (byte-order fallback, Motorola LSB start-bit conversion, CAN FD LE bit helpers, raw-range sentinel heuristic), plus expanded F# integration tests.
  • Bumped library/package versions to 0.3.1-alpha.1 and updated ROADMAP/Reports/tooling to reflect completion status and evidence.

Reviewed changes

Copilot reviewed 88 out of 105 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/oracle/vendor_dbc/toyota_prius_2010_pt.dbc Adds curated vendor DBC for oracle corpus coverage.
tests/oracle/vendor_dbc/mercedes_benz_e350_2010.dbc Adds curated vendor DBC for oracle corpus coverage.
tests/oracle/vendor_dbc/gm_global_a_chassis.dbc Adds minimal DBC for oracle smoke coverage.
tests/oracle/vendor_dbc/ford_fusion_2018_pt.dbc Adds curated vendor DBC for oracle corpus coverage.
tests/oracle/vendor_dbc/chrysler_pacifica_2017_hybrid_private_fusion.dbc Adds curated vendor DBC for oracle corpus coverage.
tests/oracle/vendor_dbc/acura_ilx_2016_nidec.dbc Adds curated vendor DBC for oracle corpus coverage.
tests/oracle/vendor_dbc/README.md Documents vendor DBC provenance and license compliance.
tests/oracle/vendor_dbc/.gitkeep Keeps vendor corpus directory present in VCS.
tests/oracle/tests/test_vector_gen.py Unit tests for oracle vector generation (incl. mux branches).
tests/oracle/tests/test_tolerance.py Unit tests for oracle tolerance/byte-compare behavior.
tests/oracle/tests/test_mux_assumptions.py Integration assertions documenting cantools mux semantics relied upon by oracle.
tests/oracle/tests/test_metadata.py Tests metadata extraction/comparison scaffolding.
tests/oracle/tests/test_harness.py Tests harness code generation + compile/run JSON protocol.
tests/oracle/tests/test_engine.py Integration tests for oracle pipeline and mux vector behavior.
tests/oracle/tests/conftest.py Pytest fixtures and markers for oracle test suite.
tests/oracle/tests/init.py Ensures oracle test package path setup.
tests/oracle/templates/oracle_harness.c C harness template implementing JSON command protocol for encode/decode.
tests/oracle/templates/.gitkeep Keeps templates directory present in VCS.
tests/oracle/run_oracle.py CLI runner for single-DBC oracle execution and JSON reporting.
tests/oracle/run_matrix.py Runner for sweeping config matrix permutations against a DBC.
tests/oracle/run_corpus.py Runner for batch oracle validation across curated/vendor corpus (and optional opendbc clone).
tests/oracle/requirements.txt Python dependencies for oracle runner and tests.
tests/oracle/pyproject.toml Python project metadata + pytest discovery configuration.
tests/oracle/oracle/vector_gen.py Oracle test vector generation, incl. adversarial and mux-per-branch support.
tests/oracle/oracle/tolerance.py Implements tolerance computation and byte-level comparison.
tests/oracle/oracle/report.py Placeholder report helpers (currently unused).
tests/oracle/oracle/metadata_compare.py Metadata extraction + divergence reporting structures.
tests/oracle/oracle/harness.py Generates/compiles/runs the oracle C harness and parses JSON responses.
tests/oracle/oracle/init.py Oracle package initialization.
tests/oracle/init.py Oracle package/module docstring.
tests/oracle/ORACLE_RESULTS.md Captures oracle corpus/matrix outcomes and reproduction commands.
tests/oracle/CATEGORY_C_EXCEPTIONS.md Defines and documents acceptable “Category C” exception criteria and evidence.
tests/Signal.CANdy.Core.Tests/DbcTests.fs Adds tests/probes for DbcParserLib ByteOrder mapping and BE fallback behavior.
tests/Generator.Tests/CodegenTests.fs Adds integration tests for comprehensive byte-level cases, CAN FD, mux, and Motorola LSB.
templates/utils.c.scriban Updates LE bit helpers (n_bytes computation, 64-bit mask handling).
src/Signal.CANdy/Signal.CANdy.fsproj Version bump to 0.3.1-alpha.1.
src/Signal.CANdy.Core/Signal.CANdy.Core.fsproj Version bump to 0.3.1-alpha.1.
src/Signal.CANdy.Core/Dbc.fs Fixes byte-order inference fallback using DbcParserLib byte-order info.
src/Signal.CANdy.Core/Codegen.fs Removes LE n_bytes clamp, fixes Motorola LSB conversion step, adds raw-range sentinel heuristic, adjusts range-check emission.
src/Signal.CANdy.Core/Api.fs Updates version() string to 0.3.1-alpha.1.
run-coverage.ps1 Adds local coverage generation script (coverlet + reportgenerator).
examples/motorola_lsb_suite.dbc Expands Motorola LSB example DBC with additional signals.
examples/main.c Adds Motorola LSB comprehensive test and extra trace output in example runner.
Reports/20260312_1800_B-O2_Oracle_Multiplex_Mode.md Session report: oracle mux mode completion evidence.
Reports/20260312_1705_Oracle_mux_assumptions_validation.md Session report: cantools mux assumptions validation.
Reports/20260312-1447_Oracle_tracking_source_of_truth_sync.md Session report: tracking/evidence hierarchy sync.
Reports/20260312-1235_Oracle_Overflow_Guardrails.md Session report: overflow guardrails rationale and verification.
Reports/20260312-1235_Oracle_DBC_Parse_Triage.md Session report: cantools parse incompatibility triage evidence.
Reports/20260312-1235_DbcParserLib_Type_Probe_Test.md Session report: ByteOrder/IsSigned probe evidence.
Reports/20260312-1235_Bug4_ZeroRange_Sentinel_Fix.md Session report: zero-range sentinel fix details.
Reports/20260312-1235_Bug2_LE_Clamp_Fix.md Session report: LE clamp removal/CAN FD fix evidence.
Reports/20260312-1235_Bug1_ByteOrder_Fallback_Fix.md Session report: byte-order fallback fix evidence.
Reports/20260312-1118_Active_Boulder_AGENTS_Audit.md Session report: plan/audit status writeup.
Reports/20260213_1952_Oracle_Integration_Result_Report.md Prior integration results report retained under Reports/.
Reports/20260213_1848_Oracle_Tolerance_Metadata_Comparison.md Prior tolerance/metadata work report retained under Reports/.
Reports/20260213_0730_Git_Workflow_Setup.md Prior repo workflow report retained under Reports/.
Reports/20260213_0000_Morning_Briefing.md Prior status briefing retained under Reports/.
Reports/20260212_1615_main_c_comprehensive_bitpattern_tests.md Prior C test work report retained under Reports/.
ROADMAP.md Updates tracking sections (Oracle O-* and backlog B-O*), and references Reports/ as source-of-truth.
AGENTS.md Adds evidence/source-of-truth guidance and updates Reports/ path conventions.
.sisyphus/boulder.json Records plan completion metadata for the agent workflow.
.gitignore Adds Python cache ignores and coverage output directories.
.config/dotnet-tools.json Adds reportgenerator dotnet tool pinning for coverage report generation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread tests/oracle/ORACLE_RESULTS.md Outdated
@InitusNovus
InitusNovus merged commit a5e3d35 into main Mar 13, 2026
4 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.

2 participants