Skip to content

Releases

dNHyDB 0.3.0

Choose a tag to compare

@github-actions github-actions released this 14 Nov 14:03

Compatibility

These changes can require changes in existing code:

  • Python 3.12–3.15. Support for Python 3.9, 3.10 and 3.11 ends
    (previously 3.9–3.14); the tomli dependency is gone.
  • None in a BASE field raises ValueError for every type (R9E-01).
    Previously utf8 silently stored the text "None" and bool stored
    False. Store a null with put_cell(u, v, None), remove a value with
    delete_cell.
  • delete_cell deletes only a live cell (a stored None included). For
    an already deleted or never written cell it returns False and writes
    nothing (R9A-04). Previously a deleted BASE field returned True again,
    and every call on a deleted cell wrote another tombstone.
  • Iterators after rollback(): open records, cells and scan
    iterators end with DnhydbError ("iterator invalidated") instead of
    returning buffered values of the discarded state (I7).
  • repair_file() no longer cuts intact committed blocks or keeps
    uncommitted blocks silently; such a repair raises CorruptionError unless
    allow_data_loss=True or keep_uncommitted=True is given (details under
    Changed).
  • Rust: Db::has_record returns Result<bool>; new error variants
    Error::Memory and Error::IoPath.

Changed

  • macOS, durability fsync: the data of a commit is now synchronized with
    F_BARRIERFSYNC (an fsync plus an I/O barrier) before the superblock is
    written, so the drive persists the data before the superblock. This
    guarantees the write order, not the persistence of the latest commits
    (the drive cache is not flushed; only full requests that). Where the
    file system does not support the barrier, dNHyDB falls back to plain
    fsync without this ordering guarantee. Single commits get slower: on an
    Apple M1 Max a commit with data takes about 1 ms instead of roughly
    0.06 ms; batch commits are barely affected. Commit less often if
    throughput matters. full, none, Linux and Windows are unchanged.
  • repair_file() (and dnhydb repair) no longer discards intact committed
    blocks or keeps uncommitted blocks silently. New options
    allow_data_loss=False and keep_uncommitted=False (CLI
    --allow-data-loss, --keep-uncommitted; Rust RepairOptions with
    Db::repair_file_opts). Without them, a repair that would lose data
    raises CorruptionError and changes nothing. The dry run reports the
    planned action; the report has new keys (superblocks,
    superblock_problem, uncommitted_bytes, missing_committed_bytes,
    damaged_blocks, later_valid_blocks, safe_end, cut_reason,
    lost_blocks, discarded_uncommitted_blocks, kept_uncommitted_blocks).
  • inspect_tail() also checks both superblocks; clean is false if a
    superblock is damaged or the commit boundary is beyond the end of the
    file or not on a block boundary.
  • verify() reports every damaged block; a stale VALUE index is reported
    under the new keys warnings/warning_count and no longer makes ok
    false (health() then reports warning instead of unhealthy).
  • A commit without new blocks writes nothing; opening, reading and closing
    leaves the file unchanged.
  • After a failed data or superblock sync during a commit, the handle is
    unusable: write methods, commit, rollback, flush, begin and
    checkpoint raise DnhydbError; close() releases handle and lock.
  • Paths are anchored as absolute paths when opening (path,
    stats()["file"] and compact()["file"] are absolute).
  • A directory as database path raises IsADirectoryError (also for
    create without overwrite); OS errors carry errno, strerror and
    filename and use the matching OSError subclass.
  • Command line: defined exit codes (0 ok, 1 problems found, 2 error without
    traceback); tail and repair without --apply exit with 1 on a file
    that is not clean; verify reports the tail inspection if a damaged file
    cannot be opened.
  • VALUE index: NaN never matches (equality or range), as in a scan.
  • A buffered (uncommitted) cell reads with the same normalised value as
    after the commit.
  • read_numpy(..., masks=True) adds "_cells": per field a bool array that
    is True where the cell lives (R9E-02). Without masks the output is
    unchanged.
  • compact(output=...) locks the target for the whole run and never
    replaces a file that appeared in the meantime (RD4-08).

Fixed

  • Data blocks found by the scan (without or beyond the catalog) and
    SECONDARY index blocks are CRC-checked before first use; damaged block
    prefixes no longer lead to silently wrong or missing values but to
    CorruptionError.
  • Opening as writer no longer truncates complete blocks behind the commit
    boundary when the other superblock is damaged; it fails with
    CorruptionError (readers read the older state).
  • create(overwrite=True) replaces the old file atomically; on failure the
    old database stays intact.
  • close() after own commits also writes the second superblock slot.
  • Repair writes new superblocks with rising generations before cutting the
    file, takes the write lock before inspecting it, and creates unique,
    synchronized backups (never overwritten within the same second); files
    that are too short or not a database are rejected unchanged.
  • Failed batch writes (put_cells, put_records, NumPy batches) leave no
    blocks behind.
  • Windows: replacing a file that is briefly in use is retried.
  • The lock file is never opened through a symbolic link; a directory or an
    empty path is rejected before the lock file is created, and a lock file
    created by a failed create is removed.
  • After close(), every method and iterator raises DnhydbError
    (including has_record, schema, verify, health, setters);
    with on a closed database raises DnhydbError, and a failed commit on
    leaving a with block still releases handle and lock.
  • Huge count values in read_numpy and allocation failures (bytes(n),
    index build) raise MemoryError instead of aborting the process.
  • Deeply nested or cyclic values raise ValueError, deeply nested
    metadata JSON raises CorruptionError (no stack overflow); values and
    groups of cells larger than 4 GiB are rejected with ValueError;
    decompression of posting lists is bounded.
  • NumPy columns of unsupported types (float16, longdouble) raise
    TypeError instead of recursing.
  • Missing required keys in the schema JSON raise CorruptionError instead
    of KeyError.
  • A side with only free cells is no longer reported as stale after
    build_indexes().
  • A block at a foreign position (copied or swapped, CRC valid) no longer
    returns old values: block ids must grow with the file position, and
    blocks known from the catalog are checked against their header; open,
    reads and verify() report CorruptionError (RD-01, RD-05).
  • Two blocks with the same id no longer crash verify(), compaction or
    point listings; they raise CorruptionError.
  • get_cell returns a value written with put_cell for a BASE field that
    the record's stored shape did not have yet (it returned None).
  • Concurrent use of one handle from several threads raises RuntimeError
    instead of PanicException in every method and iterator (R9D-01).
  • A failed define_base leaves no metadata blocks that a later commit would
    make durable.
  • A failed compaction no longer leaves <db>.compacting behind; a leftover
    is replaced under the lock (RD4-03).
  • A failed commit inside checkpoint() no longer leaves a checkpoint offset
    that points at a discarded block.

dNHyDB 0.2.0

dNHyDB 0.2.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 18 Oct 14:52

dNHyDB v0.2.0 — Mathematical Database Addressing, Now Cross-Platform

dNHyDB brings Dynadron-based mathematical cell addressing to a native Rust database engine, accessible directly from Python.

Instead of treating database addresses as merely arbitrary storage positions, dNHyDB uses a mathematically structured coordinate system derived from the Dynadron of natural numbers.

Version 0.2.0 is a major portability milestone: the engine now runs on Linux, macOS and Windows, with prebuilt Python wheels across five platform targets and six CPython versions.

One mathematical addressing principle. One native database engine. Five platform targets.

Installation

pip install dnhydb

No Rust compiler is required when installing a supported prebuilt wheel. PyPI availability follows the separately approved publishing step.

Platform Support

Operating system | Architecture | Python -- | -- | -- Linux (manylinux_2_28) | x86_64 | 3.9–3.14 Linux (manylinux_2_28) | aarch64 | 3.9–3.14 macOS | Intel x86_64 | 3.9–3.14 macOS | Apple Silicon arm64 | 3.9–3.14 Windows | x64 | 3.9–3.14

30 prebuilt wheels + 1 source distribution.

All 30 wheel installation-test jobs passed in the release pipeline, including tests on the target operating systems and Python versions.

What's New in v0.2.0

Cross-platform native storage engine

The previously Unix-specific storage implementation has been made portable across Linux, macOS and Windows.

The platform layer now provides:

  • Positional file I/O across supported operating systems.

  • Exclusive writer locking using Rust's File::try_lock.

  • Platform-specific synchronization, including FlushFileBuffers on Windows.

  • File identity detection, including volume and file identifiers on Windows, to recognize replaced database files.

  • Portable local-time handling for backup filenames.

Improved database lifecycle

close() now releases the underlying file handle and write lock immediately.

Further behavior is explicitly defined:

  • Access after closing raises DnhydbError (database is closed).

  • Repeated calls to close() are harmless.

  • If close(commit=True) cannot commit, the database remains open so the operation can be retried or discarded.

  • close(commit=False) releases the handle and lock even if buffered writing fails.

Python compatibility improvements

load_options() now supports Python 3.9 and 3.10 through the automatically installed tomli backport. Newer Python versions use their built-in TOML support.

More reliable testing and distribution

The Python test suite no longer depends on a Rust target/ directory already existing.

Tests now run correctly from fresh source checkouts and source distributions.

The release pipeline builds and verifies the complete package set, then independently installs and tests each of the 30 supported wheel combinations.

Mathematical Foundation — Unchanged

The cross-platform work does not alter the fundamental database architecture:

  • Dynadron-based mathematical cell addressing remains unchanged.

  • The existing NHYDB014 database file format remains unchanged.

  • The Rust database core continues to expose its functionality through Python/PyO3.

This release expands where dNHyDB can run without changing the mathematical principle on which it is built.

Project Status

dNHyDB is an experimental, source-available database technology under active development.

Version 0.2.0 is published as a pre-release. The project documentation describes the supported functionality, current limitations and applicable license terms.


dNHyDB v0.2.0 — From a mathematical addressing concept to a tested cross-platform database engine.

dNHyDB v0.1.0 – Initial Public Release

Choose a tag to compare

@nhydb nhydb released this 17 Oct 16:47

dNHyDB v0.1.0 — Initial Public Release

This is the first public release of dNHyDB, a lightweight database engine based on the mathematical addressing principles of the Dynadron.

Key Features

  • Native Rust database engine with Python bindings (PyO3).
  • Direct mathematical addressing of storage cells using Dynadron coordinates.
  • Exact bidirectional conversion between natural-number cell references and structural Dynadron addresses.
  • CLASSIC record layout within the first Realm.
  • Persistent storage, record operations, and secondary indexing.
  • Technical documentation in German and English.

Validation and Benchmarks

The release has been validated through 64 Rust tests and 14 Python tests.

Comparative benchmarks involving 10 million numerical records demonstrate high write throughput and compact index structures.

Scientific Background

The mathematical database principle is described in:

Das Dynadron als mathematisches Datenbankprinzip

https://doi.org/10.5281/zenodo.23438748

License

Source-available software. Usage is governed by the included LICENSE.md, which restricts use to non-production purposes.

Release Status

Initial public release — Version 0.1.0 (Alpha).