Skip to content

Benchmark SQLite and Doublets link operations in C# and Rust - #106

Merged
konard merged 16 commits into
mainfrom
issue-105-8fbc60884dea
Sep 19, 2026
Merged

konard merged 16 commits into
mainfrom
issue-105-8fbc60884dea

Conversation

@konard

@konard konard commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Fixes #105

What changed

  • adds the same link-operation workload in Rust and C#: create, update, delete, enumerate all, and lookup by identity, concrete source/target, outgoing source, and incoming target
  • compares SQLite memory/file storage with Doublets united/split volatile/non-volatile storage
  • adds Rust object-like blog-post benchmarks for all six storage variants while preserving the original C# object benchmark and documentation
  • fixes Rust Doublets link creation so source and target are actually assigned
  • prepares every iteration outside the measured region and validates all storage adapters with automated tests
  • replaces the result pipeline with strict Criterion and BenchmarkDotNet parsers, shared Markdown tables, speedup annotations, linear/log charts, provenance, and language-specific README markers
  • runs formatting, linting, tests, benchmark compilation, report tests, and reduced full-matrix benchmarks on pull requests; full main runs publish results and diagnostic artifacts

Reproduction and regression coverage

Before the fix, Rust DoubletsLinks::create produced (0, 0) links because create_by treated its argument as a restriction. The regression test now verifies the stored source and target. Storage integration tests exercise links, objects, and isolation for every Rust backend. The C# self-test exercises every operation against all six backends, including the correct high-level Doublets deletion path.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --lib --tests --benches -- -D warnings
  • cargo test --release --lib --tests (34 tests)
  • cargo check --release --benches
  • dotnet build Comparisons.SQLiteVSDoublets.sln -c Release --warnaserror
  • dotnet run -c Release --no-build -- --self-test (all six variants)
  • 18 Python parser/report tests, including chart generation and incomplete-output rejection
  • real reduced Rust matrix: 11 operations x 6 variants (66 measurements)
  • real reduced C# matrix: 8 operations x 6 variants (48 measurements)
  • actionlint for both workflow files

This is benchmark and documentation infrastructure; there are no UI changes or screenshots.

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #105
@konard konard self-assigned this Sep 16, 2026
`DoubletsLinks::create` called `Doublets::create_by([source, target])`,
but `create_by` forwards its argument to `create_links` as a *restriction*
of the query. Both the united and the split memory stores ignore that
restriction and always create an empty link, so every link the benchmarks
created was `(0, 0)` instead of connecting the two given links.

That made the `create` benchmark measure an incomplete operation, and made
the queries by source and by target search through links that were not
actually connected to anything.

`DoubletsExt::create_link` is the operation the benchmark means: it creates
a link and updates it with the source and the target, which is what
`CreateAndUpdate` does in the C# `Platform.Data.Doublets`.

The added regression test fails on the previous implementation
(`left: 0, right: 1` for the source of the created link) and passes now.
…marks

Issue #105 asks for the same object like comparison the C# benchmark does,
next to the link related one, and for the same set of storages the sibling
comparison repositories use.

Storages: `SQLite_File`, `Doublets_United_NonVolatile` and
`Doublets_Split_NonVolatile` join the three in-memory ones, so that both
databases are measured on volatile and on non-volatile memory. The file
backed subjects keep their files in the temporary directory of the machine
and remove them when they are dropped.

Objects: `BlogPost` and the `Objects` trait mirror `csharp/Model/BlogPosts.cs`
(a unique title, a lorem ipsum content and a publication date within the last
30 days, generated deterministically). SQLite stores them as rows of a
`blog_posts` table with a unique index on the title, exactly like the Entity
Framework Core model of the C# benchmark. Doublets stores them as links only:
every character is a point link, a string is the left fold of those symbols
and every property is a `((object, marker), value)` pair — the Rust
equivalent of the unicode sequences and of `PropertiesOperator` in C#.

Helpers: `fill_background` and `fill_benchmarked` build the data of an
iteration outside of the measured region, and `temp_path` gives every file
backed subject a path of its own.

Tested by `tests/storages.rs`, which runs the same link, object and
isolation checks against all six subjects, and by `examples/inspect_storage`,
which prints what each of them contains after an iteration.
…ption access disabled for this organization [oauth_org_not_allowed] — Your organization has disabled Claude subscription access for Claude Code · Use an Anthropic API key instead, or ask your admin to enable access)
@konard

konard commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

🚨 Solution Draft Failed

The automated solution draft encountered an error:

CLAUDE stopped: Subscription access disabled for this organization [oauth_org_not_allowed] — Your organization has disabled Claude subscription access for Claude Code · Use an Anthropic API key instead, or ask your admin to enable access

- Ask the organization/workspace admin to re-enable CLI access for this account.
- Or switch this run to API-key billing instead of the subscription.
- Once access is restored, resume with the session ID printed above — no work is lost.

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus (claude-opus-5)
  • Thinking level: high (~23999 tokens)
  • Model: Claude Opus 5 (claude-opus-5)

📎 Failure log uploaded as Gist (3790KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard

konard commented Sep 19, 2026 •

Copy link
Copy Markdown
Member Author

@konard

konard commented Sep 19, 2026

Copy link
Copy Markdown
Member Author

🤖 AI Work Session Started

Starting automated work session at 2026-09-19T16:40:23.708Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback.

Runtime: solve v2.29.0 · tool codex · model gpt-5.6-sol · task image konard/hive-mind-dind:2.29.0@sha256:11a236d03854cbaea86fdd7ca06265c912cf0b67d1fcc9b3eb60bd84c43ff749

@konard konard changed the title [WIP] Add comparison for Rust version of doublets + Rust client to SQLite Benchmark SQLite and Doublets link operations in C# and Rust Sep 19, 2026
@konard
konard marked this pull request as ready for review September 19, 2026 17:51
@konard

konard commented Sep 19, 2026

Copy link
Copy Markdown
Member Author

Working session summary

Implemented and finalized PR #106.

  • Added equivalent C#/Rust link-operation benchmarks across six storage variants.
  • Added strict result parsing, tables, charts, artifacts, and README publication.
  • Fixed Rust link creation and Windows SQLite file cleanup.
  • Preserved the original C# object benchmark.
  • All Linux, macOS, Windows, Rust, C#, benchmark, Codacy, and CodeFactor checks pass.
  • PR is current with main, clean, mergeable, and ready for review.

This summary was automatically extracted from the AI working session output.

@konard

konard commented Sep 19, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $23.992813

📊 Context and tokens usage:

  • 587.1K / 200K (294%) input tokens, 85.6K / 128K (67%) output tokens

Total: (587.1K + 20.9M cached) input tokens, 85.6K output tokens, $23.992813 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Thinking level: xhigh (~31999 tokens)
  • Model: GPT-5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (9908KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
konard merged commit b02084d into main Sep 19, 2026
15 checks passed
@konard

konard commented Sep 19, 2026

Copy link
Copy Markdown
Member Author

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

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.

Add comparison for Rust version of doublets + Rust client to SQLite

1 participant