Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
7e9d590
Update: gitignore
InitusNovus Feb 12, 2026
bf8256f
fix: resolve critical parsing bugs and error type loss (C-1, C-2)
InitusNovus Feb 12, 2026
0a28bf5
docs: add ROADMAP and session reports for C-1, C-2, Windows compat work
InitusNovus Feb 12, 2026
d24b693
test: add Config, Codegen, and edge case tests (H-1c, H-1d, H-1f)
InitusNovus Feb 12, 2026
f7e339b
test: add Facade tests and E2E happy-path (H-1e, H-3c)
InitusNovus Feb 12, 2026
a0ad689
docs: update ROADMAP and session report for H-1, H-3 completion
InitusNovus Feb 12, 2026
533a8e0
refactor: consolidate Generator into Core via Compat bridge (H-2, M-1)
InitusNovus Feb 12, 2026
2b1c7a7
chore: remove dead code, improve codegen readability, update deps tab…
InitusNovus Feb 12, 2026
86b7f20
feat(canfd): remove 8-byte hard limits, add CAN FD support (L-4a, L-4b)
InitusNovus Feb 12, 2026
a65592e
feat(canfd): generate DLC mapping utilities and fix signed signal dec…
InitusNovus Feb 12, 2026
ed79d6d
test: add comprehensive CAN parsing tests with known bit patterns
InitusNovus Feb 12, 2026
9d0c504
docs: update ROADMAP L-4c complete and add session report
InitusNovus Feb 12, 2026
8acba82
docs: clean up renamed report files and add 260213 morning briefing
InitusNovus Feb 12, 2026
b4edd52
chore: track AGENTS.md, Report/, and ROADMAP.md publicly
InitusNovus Feb 12, 2026
6e831f9
docs: add git workflow setup session report
InitusNovus Feb 12, 2026
7f74bf3
ci: add dev branch to CI push trigger and remove stale branches
InitusNovus Feb 13, 2026
ec5eeff
build: add global.json to pin .NET SDK 8.0.418 with latestPatch rollF…
InitusNovus Feb 13, 2026
a29954c
docs: add CI trigger cleanup and SDK pinning session report
InitusNovus Feb 13, 2026
5ad32e5
fix: remove dead Say.hello placeholder from Core Library.fs
InitusNovus Feb 13, 2026
569863c
build: bump version to 0.3.0 in fsproj and Api.fs
InitusNovus Feb 13, 2026
608573f
style: apply Fantomas formatting and add format check to CI lint
InitusNovus Feb 13, 2026
d9a1e52
Merge remote-tracking branch 'origin/main' into dev
InitusNovus Feb 13, 2026
6388095
docs: add v0.3.0 release session report
InitusNovus Feb 13, 2026
a3ece9b
Merge remote-tracking branch 'origin/main' into dev
InitusNovus Feb 13, 2026
c0c42c1
docs: add README update session report
InitusNovus Feb 13, 2026
2024b10
build: add local coverage report infrastructure (ReportGenerator + sc…
InitusNovus Feb 13, 2026
b3f5403
test: add TRACE output and expand Motorola LSB suite with hand-calcul…
InitusNovus Feb 13, 2026
a658d93
test: wire comprehensive C tests into F# integration suite
InitusNovus Feb 13, 2026
2337334
docs: add test confidence infrastructure session report
InitusNovus Feb 13, 2026
32273a4
feat(oracle): scaffold Python oracle test project structure
InitusNovus Feb 13, 2026
f0a9443
feat(oracle): add C harness template and Python harness generation
InitusNovus Feb 13, 2026
0fb1655
feat(oracle): implement core oracle engine with single-DBC pipeline
InitusNovus Feb 13, 2026
24d60ee
feat(oracle): implement dynamic tolerance framework and metadata comp…
InitusNovus Feb 13, 2026
b02e608
feat(oracle): implement core oracle engine with single-DBC pipeline
InitusNovus Feb 13, 2026
4ec591e
feat(oracle): implement test vector generation with boundary and adve…
InitusNovus Feb 13, 2026
0c7b83f
feat(oracle): implement config matrix runner with all valid permutations
InitusNovus Feb 13, 2026
1a7ccfd
feat(oracle): add vendored DBC subset and corpus runner with opendbc …
InitusNovus Feb 13, 2026
a64fb45
test(oracle): add comprehensive pytest suite for oracle harness
InitusNovus Feb 13, 2026
5371e6e
feat(oracle): complete integration testing with all example DBCs and …
InitusNovus Feb 13, 2026
0dbe1c0
chore(oracle): mark all acceptance criteria and verification items co…
InitusNovus Feb 13, 2026
9651ee3
chore(plans): archive stale plans and activate oracle-failure-resolution
InitusNovus Feb 13, 2026
04b4154
chore(oracle): remove tracked Python bytecode caches
InitusNovus Feb 19, 2026
c6f9806
chore(git): ignore Python cache artifacts
InitusNovus Feb 19, 2026
a9ff797
test(core): add DbcParserLib signal metadata type guard test
InitusNovus Feb 19, 2026
0dfb4e9
docs(oracle): sync roadmap tracking and session reports
InitusNovus Feb 19, 2026
b814621
Merge remote-tracking branch 'origin/main' into dev
InitusNovus Feb 19, 2026
a323916
fix(dbc): use DbcParserLib byte order instead of hardcoded LE fallback
InitusNovus Mar 12, 2026
407f1be
fix(codegen): correct motorolaMsbFromLsb byte boundary traversal dire…
InitusNovus Mar 12, 2026
5bcd36d
fix(codegen): remove 8-byte clamp in LE bit utilities for CAN FD support
InitusNovus Mar 12, 2026
e0fc6fa
fix(oracle): add overflow guard to vector generation for extreme scal…
InitusNovus Mar 12, 2026
11cbf02
docs(oracle): add Category C exception criteria and justification doc…
InitusNovus Mar 12, 2026
5915b8f
fix(codegen): skip range check for signals with DBC no-range sentinel…
InitusNovus Mar 12, 2026
7de2fa8
fix(codegen): skip range check for inverted DBC range sentinel (min >…
InitusNovus Mar 12, 2026
b5947c2
docs(oracle): add Category C exception 5 — dbc_raw_range_sentinel
InitusNovus Mar 12, 2026
839e777
docs(oracle): add Category C exception 5 — dbc_raw_range_sentinel
InitusNovus Mar 12, 2026
87d75f9
docs(oracle): update ORACLE_RESULTS with v3 corpus — 99.25% adjusted …
InitusNovus Mar 12, 2026
9bb071d
chore: close oracle-failure-resolution boulder — 99.25% adjusted pass…
InitusNovus Mar 12, 2026
c5aaf16
docs(agents): add evidence and historical-boundary rules
InitusNovus Mar 12, 2026
389f307
docs(roadmap): sync oracle tracking source of truth and backlog
InitusNovus Mar 12, 2026
62fa1e8
docs(reports): migrate 20260212 historical reports into Reports
InitusNovus Mar 12, 2026
b0d683c
docs(reports): migrate remaining 20260212 historical reports into Rep…
InitusNovus Mar 12, 2026
97f9cdc
docs(reports): migrate late 20260212 and early 20260213 reports into …
InitusNovus Mar 12, 2026
9945f05
docs(reports): migrate 20260213 briefing and release reports into Rep…
InitusNovus Mar 12, 2026
b8f4f54
docs(reports): migrate remaining 20260213 oracle reports into Reports
InitusNovus Mar 12, 2026
2da5061
docs(reports): migrate core oracle implementation reports into Reports
InitusNovus Mar 12, 2026
3daba60
docs(reports): migrate final oracle historical reports into Reports
InitusNovus Mar 12, 2026
b4c7280
docs(reports): add 20260312 sync and oracle completion reports
InitusNovus Mar 12, 2026
8088cfd
docs(reports): migrate 20260215 analysis report into Reports
InitusNovus Mar 12, 2026
9869dd7
docs(reports): remove stale underscore-named oracle completion report
InitusNovus Mar 12, 2026
1017b52
feat(codegen): add raw-range sentinel heuristic to skip invalid range…
InitusNovus Mar 12, 2026
9275a9f
docs: mark B-O1 complete, update oracle exception docs and reports
InitusNovus Mar 12, 2026
6ba7435
feat(oracle): add mux per-branch vector generation in engine.py
InitusNovus Mar 12, 2026
bd43dde
test(oracle): add mux-specific unit tests for per-branch vector gener…
InitusNovus Mar 12, 2026
4b53f27
docs(oracle): update Exception 1, ORACLE_RESULTS, ROADMAP for B-O2
InitusNovus Mar 12, 2026
4d19aa7
docs: add B-O2 session report
InitusNovus Mar 12, 2026
d98877c
chore: mark B-O2 complete, clear boulder state, final report
InitusNovus Mar 12, 2026
9c50acc
refactor(oracle): remove unused db param from _generate_mux_vectors
InitusNovus Mar 13, 2026
6b0f3ed
chore: bump version to 0.3.1-alpha.1
InitusNovus Mar 13, 2026
47f271b
docs: update ROADMAP footer date
InitusNovus Mar 13, 2026
1141200
docs: add stabilization session report
InitusNovus Mar 13, 2026
9bb9353
style: apply fantomas formatting fixes
InitusNovus Mar 13, 2026
dda53aa
docs(oracle): remove accidental line prefixes in ORACLE_RESULTS
InitusNovus Mar 13, 2026
fc35d6c
chore(release): align v0.3.1 versions and install docs
InitusNovus Mar 13, 2026
051c326
docs(reports): add v0.3.1 release and pre-0.3.2 diagnosis reports
InitusNovus Mar 13, 2026
d0ce378
feat(errors): add UnsupportedFeature variant to CodeGenError
InitusNovus Mar 13, 2026
3af89f2
test(codegen): add RED tests for valid bitmask auto-widening
InitusNovus Mar 13, 2026
6bbe11d
feat: auto-widen valid bitmask uint32/uint64 for mux messages (B-O3)
InitusNovus Mar 13, 2026
da4f018
fix: use haveSubstring for UnsupportedFeature message assertion in te…
InitusNovus Mar 13, 2026
c4e32b5
docs: update docs and version for v0.3.2
InitusNovus Mar 13, 2026
8826275
docs(reports): add v0.3.2 B-O3 completion session report
InitusNovus Mar 13, 2026
eb7f6c3
fix(release): handle UnsupportedFeature across caller surfaces
InitusNovus Mar 13, 2026
b7548dc
docs(reports): finalize v0.3.2 readiness and session logs
InitusNovus Mar 13, 2026
b8f945b
docs(release): align changelog and generator version for v0.3.2
InitusNovus Mar 13, 2026
bbfeb97
docs(reports): add v0.3.2 pre-PR consistency check report
InitusNovus Mar 13, 2026
6c91def
docs(release): drop repository changelog and document policy
InitusNovus Mar 13, 2026
1caa728
fix(ci): untrack boulder state and guard LE 9-byte shifts
InitusNovus Mar 13, 2026
e8f9ebb
Merge remote-tracking branch 'origin/main' into dev
InitusNovus Mar 13, 2026
e7b28e2
style: apply CI Fantomas formatting
InitusNovus Mar 13, 2026
81a4d6b
docs(reports): add PR14 review and conflict-resolution report
InitusNovus Mar 13, 2026
e0e788a
test(codegen): add failing tests for >64 valid byte-array
InitusNovus Mar 15, 2026
ed2bf51
feat(codegen): add 3-tier valid width selection for >64 signals
InitusNovus Mar 15, 2026
63d62a7
feat(codegen): emit byte-array macros, struct field, and decode body …
InitusNovus Mar 15, 2026
fa45ce9
feat(codegen): lift overflow guard from 64 to 1024 signals
InitusNovus Mar 15, 2026
60064c9
feat(codegen): add conditional sc_valid helpers and utils include
InitusNovus Mar 15, 2026
c8ad404
test(codegen): add golden files for 65-signal mux message
InitusNovus Mar 15, 2026
3b82c65
refactor(codegen): apply fantomas formatting
InitusNovus Mar 15, 2026
9b1b7bd
docs(reports): add implementation session reports for valid >64 bitma…
InitusNovus Mar 15, 2026
3bd6835
docs(reports): add final completion report for valid >64 bitmask impl…
InitusNovus Mar 15, 2026
237b427
docs: mirror 3-tier valid bitmask changes in README.ko.md
InitusNovus Mar 16, 2026
eedfed0
docs: align active documentation with shipped >64 valid bitmask byte-…
InitusNovus Mar 16, 2026
c922770
docs: add Oracle reference decoder incompatibility strategy document
InitusNovus Mar 16, 2026
1de513e
docs: add session report for truth-alignment work
InitusNovus Mar 16, 2026
178f849
docs: fix README.md multiplexed code-fence — close block 1 before blo…
InitusNovus Mar 16, 2026
ea1a5d1
docs(reports): normalize report filename prefixes to RUN-ID format an…
InitusNovus Mar 16, 2026
e74bbcd
docs(reports): add release-readiness audit and main recovery reports
InitusNovus Mar 16, 2026
0e8e560
Merge dev into recovery/local-main-20260316
InitusNovus Mar 16, 2026
014649f
docs(reports): add dev promotion session report
InitusNovus Mar 16, 2026
8c22dfe
build(version): bump package metadata to 0.4.0-alpha.1
InitusNovus Mar 16, 2026
0338bf7
docs(readme): align install docs for 0.4.0-alpha.1
InitusNovus Mar 16, 2026
25ed7a1
docs(nuget): align package install snippets for 0.4.0-alpha.1
InitusNovus Mar 16, 2026
6dd33e1
docs(reports): add 0.4.0-alpha.1 readiness report
InitusNovus Mar 16, 2026
0d934e7
test(golden): align mux65 valid macro names
InitusNovus Mar 16, 2026
a7faaba
docs(readme): fix mux65 valid macro examples
InitusNovus Mar 16, 2026
54cc723
test(codegen): use temp output dir for 1025-signal guard
InitusNovus Mar 16, 2026
b2d2295
docs(reports): add PR15 review resolution report
InitusNovus Mar 16, 2026
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
16 changes: 13 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,14 @@ let ``Validation fails for duplicate message IDs`` () =
보고서 파일명은 다음 형식을 **반드시** 따른다:

```
Reports/YYYYMMDD_HHMM_작업내용요약.md
Reports/YYYYMMDD-HHMM_작업내용요약.md
```

- `YYYYMMDD`: 작업 날짜 (예: 20260212)
- `HHMM`: 작업 종료 시각 (24시간제, 예: 1430)
- `작업내용요약`: 핵심 작업을 간결하게 (예: `Dbc_예외삼킴_수정`, `Core_테스트_구축`)

예시: `Reports/20260212_1430_Dbc_예외삼킴_수정.md`
예시: `Reports/20260212-1430_Dbc_예외삼킴_수정.md`

### 규칙 3: 보고서 필수 포함 항목

Expand All @@ -261,11 +261,21 @@ Reports/YYYYMMDD_HHMM_작업내용요약.md

### 규칙 6: 장기 실행 배치의 RUN_ID 규칙 (선택 적용)

- 기본 규칙은 위의 `Reports/YYYYMMDD_HHMM_작업내용요약.md` 단일 보고서 방식이다
- 기본 규칙은 위의 `Reports/YYYYMMDD-HHMM_작업내용요약.md` 단일 보고서 방식이다
- 다만 작업이 여러 세션에 걸쳐 이어지는 **장기 실행 배치**라면, 필요 시 `RUN_ID`(`yyyymmdd-hhmm`, KST 기준)를 정하고 여러 보고서가 동일한 RUN_ID를 공유하도록 할 수 있다
- 같은 미종료 배치를 이어서 수행하는 경우에는 새 RUN_ID를 임의로 만들지 말고 기존 RUN_ID를 재사용한다
- 이 선택 규칙은 복구성과 추적성을 높이기 위한 보강 규칙이며, 현재 레포의 기본 단일 보고서 관행을 대체하지 않는다

#### RUN_ID/파일명 운영 체크 (재발 방지)

- 보고서 파일명 prefix(`YYYYMMDD-HHMM`)는 **해당 보고서의 RUN_ID**를 사용한다
- 장기 실행 배치에서는 배치 시작 RUN_ID를 정한 뒤, 같은 배치의 후속 보고서도 같은 prefix를 사용한다
- 배치 내 개별 단계 시각은 파일명 prefix가 아니라 본문 메타(예: `배치 내 단계 시각`)로만 기록한다
- 기록 정정이 필요한 경우:
1. 원본 보고서 제목/본문보다 파일명 prefix 정합성을 우선 맞춘다
2. 본문에 `[정정 이력 - YYYY-MM-DD]`로 변경 근거를 남긴다
3. 기존 이력을 지우지 않고 patch-forward 방식으로 누적 기록한다

---

> 이 규칙들은 프로젝트의 **추적 가능성(traceability)**과 **재현 가능성(reproducibility)**을 보장하기 위한 것입니다.
Expand Down
103 changes: 103 additions & 0 deletions Plans/ORACLE_DECODER_STRATEGY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Oracle Reference Decoder Incompatibility Strategy

## Problem Statement
Three vendor DBC files from the testing corpus are currently excluded from oracle verification because the primary reference decoder, `cantools` (v41.2.1), fails to parse them. These files were classified as Exception 4 in `tests/oracle/CATEGORY_C_EXCEPTIONS.md`.

**Affected Files and Errors:**
1. **hyundai_kia_generic.dbc**: Malformed `CM_` records at lines 1655-1657. `cantools` fails to handle unexpected formatting in comment records.
2. **toyota_2017_ref_pt.dbc**: 29-bit extended IDs rejected at line 387. `cantools` throws a "Standard frame id is more than 11 bits" error, suggesting it incorrectly treats extended frames as standard frames or fails to recognize the bit-31 extended flag.
3. **vw_meb.dbc**: 29-bit extended IDs rejected at line 2074. Same root cause as the Toyota DBC.

Signal-CANdy successfully parses these files and generates valid C99 code, but the lack of a reference decoder prevents signal-level oracle verification for these specific targets.

## Current State and Impact
- **Exclusion Rate**: 3 significant vendor DBC files (Hyundai, Toyota, VW) are entirely excluded from the automated oracle pipeline.
- **Verification Gap**: Changes to core logic affecting extended IDs or specific parsing edge cases cannot be cross-validated against a gold standard for these files.
- **Classification**: These files are permanently assigned to `Category C` (reference\_decoder\_incompatible), which lowers the effective oracle coverage of the project.

## Decision Context
The project needs to decide whether to invest in a more robust or alternative reference decoder to achieve 100% oracle coverage or maintain the current status quo where `cantools` remains the sole, albeit limited, source of truth.

## Option A: Maintain cantools-only + Category C policy (Status Quo)
### Description
Continue using `cantools` v41.2.1 as the exclusive reference decoder. Files that fail to parse are documented as Category C exceptions and excluded from oracle runs.

### Evidence/Rationale
`cantools` is the industry standard for Python-based CAN toolchains. Exception 4 documents that these failures are external to Signal-CANdy.

### Pros
- Zero additional implementation or maintenance effort.
- Consistent environment (only one reference tool to manage).
- Clear boundary: if the industry standard cannot parse it, exclusion is defensible.

### Cons
- Permanent verification gaps for high-value vendor DBCs.
- Reduced confidence in generated code for extended ID messages (J1939/CAN FD style).

### Effort: None
### Recommendation Score: 6/10

## Option B: Replace cantools with an alternative reference decoder (e.g., canmatrix)
### Description
Migrate the `run_oracle.py` and `engine.py` logic to use `canmatrix` or a similar library as the primary reference.

### Evidence/Rationale
Research indicates `canmatrix` is generally more lenient with DBC syntax anomalies (like the Hyundai `CM_` issue) and has a more flexible internal model for extended IDs.

### Pros
- Potential to resolve all 3 current Exception 4 cases.
- `canmatrix` supports a wider range of formats (.arxml, .kcd), potentially expanding future test scope.

### Cons
- High migration effort: `run_oracle.py` is tightly coupled with the `cantools` API.
- `canmatrix` is often cited as being slower and having a less "mature" high-level API than `cantools`.
- Risk of introducing new Category C exceptions for files `cantools` handled but `canmatrix` might struggle with.

### Effort: High
### Recommendation Score: 3/10

## Option C: Hybrid approach (cantools with fallback or canmatrix-based patching)
### Description
Keep `cantools` as the primary engine but implement a secondary path for Exception 4 files. This could involve using `canmatrix` just for the problematic files or implementing a pre-processing script to "fix" the DBCs before feeding them to `cantools`.

### Evidence/Rationale
The Toyota/VW errors ("Standard frame id is more than 11 bits") often stem from DBCs lacking the bit-31 flag that tools like `cantools` expect for extended IDs. A simple Python script could set these flags or clean malformed `CM_` records.

### Pros
- Resolves the verification gap for the 3 current files.
- Retains the performance and stability of `cantools` for the bulk of the corpus.
- Incremental effort.

### Cons
- Increases complexity of the test harness.
- "Fixing" DBCs for the reference tool might mask genuine parsing bugs if not handled carefully.

### Effort: Medium
### Recommendation Score: 8/10

## Recommended Path
**Implement Option C (Hybrid/Pre-processing fallback).**

Evidence suggests the current failures are solvable with targeted interventions:
1. **For Extended IDs (Toyota/VW)**: A pre-processing step can identify IDs > 0x7FF and ensure the extended bit is set (or use `canmatrix` to load and re-save the DBC in a "standardized" format).
2. **For Malformed CM_ (Hyundai)**: A simple regex-based "sanitizer" can fix the syntax anomalies before `cantools` reads the file.

This approach provides the highest verification gain (resolving all 3 exclusions) with significantly less risk and effort than a full migration to a new decoder.

## Decision Criteria
- **Coverage**: Does it resolve the 3 excluded files?
- **Stability**: Does it preserve existing verification for the rest of the corpus?
- **Maintenance**: How much extra code is added to the test suite?
- **Speed**: Does it impact CI run times?

## Open Questions
- Can a simple `sed`/`regex` fix the Hyundai `CM_` records without changing signal data?
- Does `cantools` have an undocumented "lenient" mode that could be enabled via flags?
- Is the extended ID issue in Toyota/VW DBCs a bug in the DBC files themselves (missing flag) or a strictness issue in `cantools`?

## References
- `tests/oracle/CATEGORY_C_EXCEPTIONS.md` Exception 4
- `tests/oracle/ORACLE_RESULTS.md` Remaining Category C, Recommendation #4
- `Plans/ROADMAP.md` Oracle decoder strategy item
- [cantools Issue #301: Standard frame id is more than 11 bits](https://github.com/cantools/cantools/issues/301)
- [canmatrix documentation: Lenient DBC parsing](https://canmatrix.readthedocs.io/en/latest/formats.html)
10 changes: 2 additions & 8 deletions Plans/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@

## 현재 이관된 후속 항목

### 1. valid 비트마스크 `>64` 신호 fallback 방식

- 현 상태: `≤32 -> uint32_t`, `33–64 -> uint64_t`, `>64 -> UnsupportedFeature`
- 근거: `Plans/Archive/ROADMAP_202602_202603_Closed.md` L-3a close-out 문구, `tests/oracle/CATEGORY_C_EXCEPTIONS.md` Exception 3
- 후속 판단 과제: 배열 기반 valid 표현을 실제로 도입할지, 아니면 `>64` 미지원을 장기 정책으로 유지할지 결정

### 2. Oracle reference decoder 비호환 DBC 대응 전략
### 1. Oracle reference decoder 비호환 DBC 대응 전략

- 현 상태: 일부 벤더 DBC는 `cantools` 파서 비호환으로 Category C 처리
- 근거: `tests/oracle/CATEGORY_C_EXCEPTIONS.md` Exception 4, `tests/oracle/ORACLE_RESULTS.md`
Expand All @@ -27,5 +21,5 @@
## 다음 세션 진입점

1. 최신 close-out / verification 보고서를 먼저 확인한다.
2. 위 두 항목 중 실제 제품 우선순위가 생긴 것만 새 세대 계획으로 승격한다.
2. 위 항목의 실제 제품 우선순위가 생기면 새 세대 계획으로 승격한다.
3. 새 계획을 시작할 때는 archive 문서를 수정하지 않고, 이 문서 또는 `Plans/` 하위 successor roadmap에서 이어간다.
25 changes: 21 additions & 4 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
설치:

```pwsh
dotnet add package SignalCandy.Core --version 0.3.2
dotnet add package SignalCandy --version 0.3.2
dotnet add package SignalCandy.Core --version 0.4.0-alpha.1
dotnet add package SignalCandy --version 0.4.0-alpha.1
```

## ⚡ 빠른 시작 (5분)
Expand Down Expand Up @@ -457,7 +457,7 @@ make -C gen build
참고
- 분기 선택은 스위치 신호의 원시 정수값 기준입니다(일반 DBC 관례).
- 멀티플렉스가 아닌 기반 신호는 항상 디코드/인코드됩니다.
- 유효성 비트마스크 폭: 신호가 ≤32개인 메시지는 32비트 `valid` 필드(`uint32_t`)를 사용합니다; 33–64개 신호는 자동으로 64비트 필드(`uint64_t` + `1ULL` 시프트)를 사용합니다. 64개 초과 신호는 생성할 수 없으며 — 코드 생성은 `CodeGenError.UnsupportedFeature`를 보고합니다.
- 유효성 비트마스크 폭: 신호가 ≤32개인 메시지는 32비트 `valid` 필드(`uint32_t`)를 사용합니다; 33–64개 신호는 자동으로 64비트 필드(`uint64_t` + `1ULL` 시프트)를 사용합니다; 65–1024개 신호는 바이트 배열 필드(`uint8_t valid[(N+7)/8]`)와 `sc_valid_set/clear/test()` 헬퍼 함수(`sc_utils.h`)를 사용합니다. 1024개 초과 다중화 신호 메시지는 지원되지 않습니다(코드 생성 시 `CodeGenError.UnsupportedFeature` 보고).

valid와 mux_active 사용
```c
Expand All @@ -482,6 +482,23 @@ void handle_mux(const uint8_t data[8]) {
}
```

sc_valid_test 사용 (>64개 신호 — 바이트 배열 valid)
```c
#include "mux65_msg.h"
#include "sc_utils.h" /* sc_valid_test 헬퍼 — file_prefix가 sc_인 경우 sc_utils.h로 생성 */

void handle_mux65(const uint8_t data[8]) {
MUX65_MSG_t m = {0};
if (MUX65_MSG_decode(&m, data, 8)) {
if (m.mux_active == MUX65_MSG_MUX_5) {
if (sc_valid_test(m.valid, MUX65_MSG_VALID_BRANCH_5)) {
/* m.Branch_5 사용 — >64개 신호 메시지의 인덱스 기반 valid 검사 */
}
}
}
}
```

### 값 테이블 (VAL_)

`VAL_` 매핑이 있는 시그널은 C enum과 `to_string` 헬퍼가 생성됩니다:
Expand Down Expand Up @@ -606,7 +623,7 @@ void compare_state(int v) {
- 실제 CRC/Counter 생성 검증은 명시적 `crc_counter:` YAML 메타데이터가 필요하며, 현재 지원 알고리즘은 CRC-8만 해당합니다.
- 현재 `crc_counter_check: true`는 지원되지 않는 경로를 조용히 통과시키지 않도록 하는 fail-fast 가드레일로 동작합니다.
- 클래식 CAN(최대 8바이트)과 CAN FD(최대 64바이트) 페이로드를 모두 지원합니다
- 32개 초과의 다중화(mux) 시그널이 있는 메시지는 `uint64_t` valid 비트마스크를 자동 사용합니다. 64개 초과 시그널 메시지는 코드 생성 시 `CodeGenError.UnsupportedFeature`를 반환합니다
- ≤32개 다중화(mux) 시그널 메시지는 32비트 `valid` 비트마스크(`uint32_t`)를 사용합니다; 33–64개 신호는 64비트(`uint64_t`)를 사용합니다; 65–1024개 신호는 바이트 배열(`uint8_t valid[(N+7)/8]`)과 `sc_utils.h`의 `sc_valid_set/clear/test()` 헬퍼를 사용합니다. 1024개 초과 다중화 신호 메시지는 지원되지 않습니다(`CodeGenError.UnsupportedFeature`).

## 디스패치 모드와 레지스트리 (nanopb와의 관련성)

Expand Down
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ This project generates portable C99 parser modules (headers/sources) from a `.db
Install:

```pwsh
dotnet add package SignalCandy.Core --version 0.3.2
dotnet add package SignalCandy --version 0.3.2
dotnet add package SignalCandy.Core --version 0.4.0-alpha.1
dotnet add package SignalCandy --version 0.4.0-alpha.1
```

## ⚡ Quick Start (5 minutes)
Expand Down Expand Up @@ -326,7 +326,7 @@ make -C gen build
Notes
- Branch selection uses the raw integer value of the switch signal (typical DBC semantics).
- Base (non-multiplexed) signals are always decoded/encoded.
- Valid bitmask width: messages with ≤32 signals use a 32-bit `valid` field (`uint32_t`); messages with 33–64 signals automatically use a 64-bit field (`uint64_t` + `1ULL` shift). Messages with >64 signals cannot be generated — codegen reports `CodeGenError.UnsupportedFeature`.
- Valid bitmask width: messages with ≤32 signals use a 32-bit `valid` field (`uint32_t`); messages with 33–64 signals automatically use a 64-bit field (`uint64_t` + `1ULL` shift); messages with 65–1024 signals use a byte-array field (`uint8_t valid[(N+7)/8]`) with `sc_valid_set/clear/test()` helper functions from `sc_utils.h`. Messages with >1024 multiplexed signals are not supported (codegen reports `CodeGenError.UnsupportedFeature`).

Using valid and mux_active
```c
Expand All @@ -351,6 +351,23 @@ void handle_mux(const uint8_t data[8]) {
}
```

Using sc_valid_test for >64 signals (byte-array valid)
```c
#include "mux65_msg.h"
#include "sc_utils.h" /* sc_valid_test helper — emitted as sc_utils.h when file_prefix is sc_ */

void handle_mux65(const uint8_t data[8]) {
MUX65_MSG_t m = {0};
if (MUX65_MSG_decode(&m, data, 8)) {
if (m.mux_active == MUX65_MSG_MUX_5) {
if (sc_valid_test(m.valid, MUX65_MSG_VALID_BRANCH_5)) {
/* use m.Branch_5 — index-based valid check for >64 signal messages */
}
}
}
}
```

### Value tables (VAL_)

Signals with `VAL_` mappings get C enums and to_string helpers:
Expand Down Expand Up @@ -680,7 +697,8 @@ Details can be reproduced via the stress suite and bulk runner in `scripts/bulk_
- Generated CRC/Counter handling requires explicit `crc_counter:` YAML metadata; current supported algorithms are CRC-8 only.
- When `crc_counter_check: true` is enabled without explicit metadata, code generation fails fast for inferred CRC/counter-like signals instead of silently accepting an unsupported path.
- Supports both classic CAN (up to 8-byte) and CAN FD (up to 64-byte) payloads
- Messages with >32 multiplexed signals automatically use a 64-bit `valid` bitmask (`uint64_t`). Messages with >64 multiplexed signals are not supported (code generation reports `CodeGenError.UnsupportedFeature`).
- Messages with ≤32 multiplexed signals use a 32-bit `valid` bitmask (`uint32_t`); 33–64 signals use 64-bit (`uint64_t`); 65–1024 signals use a byte-array (`uint8_t valid[(N+7)/8]`) with `sc_valid_set/clear/test()` helpers from `sc_utils.h`. Messages with >1024 multiplexed signals are not supported (`CodeGenError.UnsupportedFeature`).


## Dispatch modes, registry, and relation to nanopb

Expand Down
54 changes: 54 additions & 0 deletions Reports/20260316-0749_Codegen_ValidBitmask_RED_Tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 작업 보고서: Codegen_ValidBitmask_RED_Tests

**RUN_ID**: 20260316-0749
**배치 내 단계 시각(원본 파일명 기준)**: 20260316_0749

## 📝 작업 요약

- `tests/Signal.CANdy.Core.Tests/CodegenTests.fs`에 `>64` valid bitmask byte-array 기능용 RED 단계 테스트(T1–T6)를 추가/보강했다.
- 기존 65-signal UnsupportedFeature 테스트를 성공 기대 테스트로 전환했고, 128/72/1024/1025/조건부 utils emission/비-mux 100-signal 시나리오를 추가해 현재 구현 한계를 명시적으로 깨뜨리도록 만들었다.
- 요청된 로컬 커밋 `e0e788a` (`test(codegen): add failing tests for >64 valid byte-array`)를 생성했다.

## 🛠 변경 상세

- 수정 파일: `tests/Signal.CANdy.Core.Tests/CodegenTests.fs`
- 기존 `valid bitmask uses uint64_t for 64-signal mux message` 테스트에 `uint8_t` 배열이 나오지 않아야 함 / `1ULL` shift 사용 확인 assertion을 추가했다.
- 기존 65-signal mux valid bitmask 테스트를 `valid bitmask uses uint8_t byte array for 65-signal mux message`로 리팩터링했다.
- 실제 temp output directory 생성/정리 패턴으로 변경.
- header/source에 대해 `uint8_t valid[9]`, `VALID_BYTES`, plain index macro, `sc_utils.h`, `memset`, `sc_valid_set` 기반 동작을 기대하도록 작성.
- 신규 테스트 추가:
- `valid bitmask uses uint8_t byte array for 128-signal mux message`
- `utils header emits sc_valid helpers only when a message has more than 64 mux signals`
- `codegen fails with UnsupportedFeature for 1025-signal mux message`
- `valid bitmask uses uint8_t byte array for 72-signal mux message`
- `valid bitmask uses uint8_t byte array for 1024-signal mux message`
- 기존 non-mux 다신호 테스트를 `non-mux message with 100 signals has no valid field`로 확장했다.
- 추가 확인:
- `lsp_diagnostics` 기준 변경 파일 컴파일 진단 오류 없음.

## ✅ 테스트 결과

- 실행 명령: `dotnet test --configuration Release -v minimal --nologo`
- 결과:
- 빌드/테스트 실행 자체는 성공적으로 시작되었고 테스트 프로젝트 컴파일 오류는 없었다.
- `Signal.CANdy.Core.Tests`에서 총 6개 실패, 124개 통과.
- 실패한 신규/변경 테스트:
- `valid bitmask uses uint8_t byte array for 65-signal mux message`
- `valid bitmask uses uint8_t byte array for 128-signal mux message`
- `utils header emits sc_valid helpers only when a message has more than 64 mux signals`
- `codegen fails with UnsupportedFeature for 1025-signal mux message`
- `valid bitmask uses uint8_t byte array for 72-signal mux message`
- `valid bitmask uses uint8_t byte array for 1024-signal mux message`
- 실패 원인 요약:
- 현재 구현이 `>64` mux valid bitmask를 여전히 `UnsupportedFeature`로 처리한다.
- 1025-signal guard 메시지도 새 기대치(`1024`)와 불일치한다.
- 이는 RED phase 기대 결과와 일치한다.
- `Generator.Tests`: 27개 통과.

## ⏭ 다음 계획

- 활성 ROADMAP 항목: `Plans/ROADMAP.md`의 `1. valid 비트마스크 >64 신호 fallback 방식`.
- 다음 세션에서는 byte-array 기반 valid 표현(`uint8_t valid[N]`, helper emission, set/clear/test 호출, upper bound 정책)을 `src/Signal.CANdy.Core/Codegen.fs` 및 관련 템플릿에 구현하는 GREEN phase 작업이 필요하다.
- 선행 조건:
- 이번 RED 테스트 기대치를 구현 설계와 정렬할 것.
- 현재 작업에서 완료된 ROADMAP 체크박스는 없음.
Loading
Loading