Skip to content

Improve UCIS compliance for the new NCDB database#45

Merged
mballance merged 4 commits intomasterfrom
mballance/ncdb-ucis-compliance
Mar 2, 2026
Merged

Improve UCIS compliance for the new NCDB database#45
mballance merged 4 commits intomasterfrom
mballance/ncdb-ucis-compliance

Conversation

@mballance
Copy link
Copy Markdown
Member

No description provided.

Phase 1: Scope goal and source type
- Add PRESENCE_GOAL and PRESENCE_SOURCE_TYPE to scope_tree.bin
- Scope goal (coverage percentage target) now round-trips
- Source type (SourceT enum) now round-trips

Phase 2: Per-coveritem flags
- New coveritem_flags.bin ZIP member for sparse flag storage
- Delta-encoded (coveritem_index, flags) pairs
- Supports exclusion flags (EXCLUDE_PRAGMA/FILE/INST/AUTO)
  and type-qualified flags (IS_BR_ELSE, IS_FSM_RESET, etc.)

Phase 3: Attribute system redesign
- attrs.bin v2 format with sections for scopes, coveritems,
  history nodes, and global (DB-level) attributes
- MemCoverIndex gains setAttribute/getAttribute/getAttributes
- MemHistoryNode gains setAttribute/getAttribute/getAttributes
- Backward compatible: v1 JSON still readable

Phase 4-5: Properties and tags (already working)
- EXPR_TERMS, DU_SIGNATURE round-trip via existing properties.json
- History hierarchy and scope tags already supported

Test: 14 new compliance tests in test_ucis_compliance.py
Full suite: 1002 passed, 0 failed
The UCIS LRM defines IS_32BIT, HAS_GOAL, HAS_WEIGHT as structural
flags determined by cover type, not per-bin state. All CVGBIN items
have IS_32BIT|HAS_GOAL|HAS_WEIGHT (0x19); all others have IS_32BIT
(0x01). These are now stored in COVER_TYPE_DEFAULTS and applied
automatically during deserialization.

coveritem_flags.bin only stores flags that DIFFER from the type
default (exclusion flags, IS_BR_ELSE, IS_FSM_RESET, etc.). For
typical databases this means 0 entries → member not written.

Impact on merged.vdb benchmark (131K bins):
- coveritem_flags.bin: 264KB → 0 (not written)
- Read:  3.13s → 2.79s (-11%, ~340ms saved)
- Write: 2.71s → 2.63s (-3%, ~80ms saved)
- Merge: unchanged (fast path never touches flags)

Full test suite: 1002 passed, 0 failed
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
@mballance mballance merged commit 11f172d into master Mar 2, 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.

1 participant