oxiland 0.13.0

Embedded RDF datasets, SPARQL, persistence, and streaming I/O for Rust
Documentation
# Milestone 0.12 performance report

Status: complete
Milestone: [`0.12`](../milestones/0.12.md)
Depends on: [`0.11`](../milestones/0.11.md) (complete)
Decision: [ADR-028](../DECISIONS.md#adr-028-012-competitive-parity-performance-gate)

## Summary

0.12 closes the performance gate on the three-host `release-default` matrix
under **ADR-028 competitive-parity** thresholds (throughput median ≥ `0.90`
with CI lower > `0.85`; latency median ≤ `1.20` with CI upper < `1.40`),
measured only from Cargo `--release` / production compiles, with frozen RSS
budgets and retained 0.11 parity. Matched native builds show near parity with
system Redland; this milestone does **not** authorize a blanket
“faster than Redland” marketing claim.

## Strict optimized-tip highlight

After the 0.12 optimization pass and benchmark-isolation fix, a corrected
macOS/arm64 run beat genuine system Redland 1.0.17 in all ten required strict
cases. Throughput ratios ranged from 1.598× to 29.350×; ASK latency was 0.106×
Redland. Every paired-bootstrap 95% confidence interval cleared parity. Peak
RSS ratios were 1.012× for parsing and 1.246× for SELECT against the 1.25 cap.

This result is scoped to the measured host. Suite-wide cross-platform
authorization is the separate ADR-029 / milestone 0.13 nine-cell gate
([0.13 report](0.13.md)).

## Work-package status

| Package | State | Evidence |
|---|---|---|
| WP-12-01 freeze suite + budgets | complete | frozen `0.12-suite.json` / `0.12-matrix.json`; `R-RSS-PARSE`/`R-RSS-QUERY` max `1.25` |
| WP-12-02 profile losses/ties | complete | tip ratios below; attribution in this report |
| WP-12-03 C-call / handle overhead | complete | hot `librdf_model_size`, cardinality cache, TLS amortization |
| WP-12-04 scan / stream paths | complete | lazy `get_object`, hot `end`/`next`, `from_triples` / `from_matches` |
| WP-12-05 mutation, I/O, query gaps | complete | insert coalescing; query graph `mem::take` into streams |
| WP-12-06 Windows competitiveness | complete | same ADR-028 gate; CI `qualify-0.12` matrix |
| WP-12-07 resource budgets | complete | RSS ratios in evidence `resource_checks` |
| WP-12-08 gate tooling | complete | `build-0.12-performance-evidence.py`, `qualify-0.12.yml`, `check-0.12-release.py` |
| WP-12-09 parity retention | complete | embedded `check-0.11-release.py` on the candidate ancestry |
| WP-12-10 docs and published ratios | complete | this report; `docs/users/performance.md`; `0.12.0-release.md` |
| WP-12-11 release decision | complete | R-022 closed for this gate; soak record |

## Optimizations (attribution)

- **Cardinality cache** on C models; invalidate on every mutating path.
- **`borrow_handle_hot`** / generation-bound validation for trivial getters.
- **`librdf_model_size`**: world-owned tombstones enable direct cached-size
  reads while rejecting stale handles; Windows also has a generation-bound hot
  handle cache.
- **Streams**: exact known lengths make unobserved `end`/`next` traversal
  constant-time; row decoding and statement creation wait for `get_object`.
- **Memory inserts**: coalesce pending quads into one Oxigraph transaction on flush.
- **Parsing**: direct string parsing and bounded 4,096-quad transactions retain
  progressive partial-load behavior.
- **Serialization**: write directly to the C-returned growable `malloc` buffer.
- **SELECT**: retain configured queries, apply limit/offset, flatten row
  storage, and materialize C nodes only when getters observe them.
- **Release profile**: fat LTO + `codegen-units = 1`; C harness `-O3 -march=native`.
- **Query CONSTRUCT**: store `Vec<Triple>` and move into stream without double-clone.

## Historical frozen ratios

!!! warning

    This table predates the runtime-library isolation fix. The earlier runner
    could expose Oxiland's compatibility library to the Redland-linked process,
    so these values are retained only as a historical qualification record and
    are superseded for speed claims by the corrected strict runner.

Median Oxiland/Redland ratios from
`compatibility/qualification/performance/0.12/` (production compile,
`synthetic: false`):

| Case | Linux | macOS | Windows |
|---|---:|---:|---:|
| `P-MUT-1K` | 0.993 | 1.013 | 1.009 |
| `P-MUT-10K` | 1.000 | 0.969 | 1.027 |
| `P-SCAN-10K` | 1.001 | 0.988 | 1.060 |
| `P-PARSE-TTL-1K` | 1.037 | 0.984 | 1.074 |
| `P-PARSE-TTL-10K` | 0.997 | 0.967 | 0.942 |
| `P-SER-NQ-10K` | 1.008 | 0.998 | 0.987 |
| `P-ASK-10K` | 0.978 | 0.946 | 1.074 |
| `P-SELECT-10K` | 0.995 | 0.997 | 0.964 |
| `P-GRAPH-10K` | 1.012 | 0.985 | 1.062 |
| `P-CALL-100K` | 1.000 | 0.968 | 0.929 |

`python3 scripts/check-0.12-release.py` and `python3 scripts/check-0.11-release.py`
both pass on the tip that carries this bundle.

## Tip CI diagnostic ratios (post isolation)

Independent GitHub Actions measurements from
[0.12 Qualification run 30848514245](https://github.com/eddiethedean/oxiland/actions/runs/30848514245)
on tip `57f3d3ddaffd74b022767d928b52e24988a53a5a`, after the runtime-library
isolation fix. Protocol matches the frozen 0.12 suite (40 samples, production
compile, ADR-028 thresholds). These samples are **diagnostic** and do not
replace the committed release-gate bundle above. Raw JSON:
`compatibility/qualification/performance/0.12-ci-diagnostic/`.

Median Oxiland/Redland ratios (throughput: higher is better; latency: lower is
better):

| Case | Linux | macOS | Windows |
|---|---:|---:|---:|
| `P-MUT-1K` | 3.808 | 3.771 | 1.009† |
| `P-MUT-10K` | 46.177 | 29.731 | 1.027† |
| `P-SCAN-10K` | 1.593 | 2.274 | 1.060† |
| `P-PARSE-TTL-1K` | 4.768 | 5.547 | 1.074† |
| `P-PARSE-TTL-10K` | 37.689 | 31.858 | 0.942† |
| `P-SER-NQ-10K` | 7.109 | 6.629 | 0.987† |
| `P-ASK-10K` | 0.280 | 0.346 | 1.074† |
| `P-SELECT-10K` | 1.191 | 1.659 | 0.964† |
| `P-GRAPH-10K` | 1.382 | 2.077 | 1.062† |
| `P-CALL-100K` | 1.447 | 0.818‡ | 0.929† |

RSS Oxiland/Redland ratios (max `1.25`):

| Budget | Linux | macOS | Windows |
|---|---:|---:|---:|
| `R-RSS-PARSE` | 0.657 | 0.953 | 0.998† |
| `R-RSS-QUERY` | 0.881 | 1.222 | 1.003† |

† Windows CI uploaded the committed historical `34c0976…` bundle for that host
(the Windows collector did not land a fresh tip measurement in this run).
‡ macOS `P-CALL-100K` missed the competitive-parity median floor on this
noisy Actions runner (`0.818`, 95% CI `[0.717, 1.203]`); Linux cleared the
same case at `1.447`. Release qualification continues to bind to the committed
three-host bundle, not these diagnostic uploads.

Linux and macOS tip CI results align with the corrected strict local highlight:
after isolating Redland from Oxiland’s compatibility library path, matched
production builds show large wins on mutation, parse, and serialize, with ASK
latency well under Redland.

## Claims policy

Publish per-case median ratios with confidence intervals, host, profile, suite
revision, and compile provenance only. The corrected macOS/arm64 10/10 result
and the tip CI Linux/macOS diagnostic tables may be cited with that host and
run scope. Suite-wide faster-than-Redland is authorized by the ADR-029
nine-cell bundle ([0.13 report](0.13.md)), not by a single-host or
single-run win.