โ˜ฐ ๐Ÿ 

Context

What this proves in practice:

  • C++ and Rust can coexist and be swapped without touching Python code, tests, or docs
  • Stable portal imports survive rebuilds and language changes
  • Tests enforce semantic equivalence across implementations
  • Documentation is always derived from actual runtime behavior

Migration from one native backend to another is trivial - ideal for prototyping, optimization, or legacy replacement.

Native ASCII CSV readers

This page describes a pair of deliberately simple native reference implementations used as integration and verification anchors for Hydra Forge.

The problem domain is intentionally unremarkable. The purpose of the example is not to demonstrate parsing techniques, but to demonstrate how native code moves through the system: from source, to compilation, to Python exposure, to verification, to documentation, without introducing fragility or hidden coupling.


The invariant-driven workflow

These invariants are enforced through a deterministic execution loop:


Implementations

This example exists to demonstrate a complete native integration cycle:

Both implementations expose an identical Python-facing interface and are interchangeable at the call site.

The engine does not care how the code was authored. It may be written by hand, adapted from legacy systems, or produced with the assistance of automated tools. Only the exposed behavior matters.


At any point, one implementation can be replaced with another by changing a single Python import - nothing else.

Hydra Forge enforces structure, not behavior. Engineers are free to bypass, replace, or remove native components entirely - the workflow adapts, it does not constrain.


Rebuilds are derived, not fragile

Compiled native artifacts were deleted manually. No configuration files were changed.

A single engine command rebuilt, reintegrated, and re-exposed both native implementations.

Native state is derived from source, inventory, and exposure rules - not from incremental build residue.

Hydra Forge native rebuild and exposed API tree
Native artifacts removed, rebuilt, and re-exposed deterministically. Both C++ and Rust implementations are detected, compiled, and surfaced through a structured Python API in a single engine pass.

Both are compiled and exposed through Hydra Forge, and both present the same Python-facing interface, with a subtle but intentional difference. One reader is deliberately exposed under portal.io., the other one defaults to portal.flat..


from HydraForge_Windows11.portal.io import ascii_csv_reader
from HydraForge_Windows11.portal.flat.ascii_csv_reader_rs import read_ascii_csv_rs

Python code does not import binaries, loaders, or bindings directly. It imports a stable, generated API surface.

Tested together, not separately

Both native implementations are exercised in the same test suite. They are not validated in isolation.


a = read_cpp(path)
b = read_cpp(path)
c = read_rust(path)
d = read_rust(path)

for key in a:
    np.testing.assert_array_equal(a[key], b[key], c[key], d[key])

Each implementation is invoked multiple times to assert determinism and absence of hidden state. This test enforces a stronger invariant than correctness: semantic equivalence across independent implementations.

Hydra Forge test suite passing with native implementations
Both native implementations are exercised in the same test run. Determinism, correctness, and interface stability are enforced across languages and rebuilds.

This makes native experimentation cheap. Implementations can be replaced without changing Python code, tests, or documentation structure.

Documentation reflects runtime reality

Documentation is generated from the same artifacts used at runtime:

There is no hand-maintained documentation layer. If a function is importable, it is documented. If it is not importable, it does not appear.

The authoritative reference for this example is the generated library documentation itself.

Inspect the generated API documentation โ†—

What this example actually proves

Hydra Forge does not write code or fix algorithms. It removes scaffolding, wiring, and integration friction - so engineers can focus on **their** engineering.


What you should inspect

The value of this example is not in how CSV is parsed, but in what the system produces around it.

All of these artifacts are produced automatically and can be inspected directly in the generated library. No manual wiring or duplication is required.


Why this example matters

Native integration failures typically occur at boundaries:

This example exists to show that Hydra Forge makes those boundaries explicit, inspectable, and safe.

If this example fails, the system fails. There is no partial success mode.

The value of this example lies in the confidence it provides about the system that produced it.

See verified examples executed live