Repository navigation
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #127
…onal Doublets variant doublets 0.21.0 fixes the growth of the store memory and the split store self-reference update, so memory::Whole and the update to (0, 0) are gone; experiments/unit_store_growth and experiments/split_store_delete pass on it. SQLite_File_Tuned runs PRAGMA cache_size = -1048576 and mmap_size = 1 GiB before the schema. Doublets_United_NonVolatile_Transactional is an opt-in links variant: the united store behind TransactionsDecorator with the shipped FileTransitionLog, one transaction per lifecycle phase begun on its first write.
…0.0, add the tuned SQLite file variants to C# Both providers run PRAGMA cache_size = -1048576; PRAGMA mmap_size = 1073741824; before the schema in SQLite_File_Tuned and SystemDataSQLite_File_Tuned.
…oublets 1.0.0 experiment results
…e transactional store and the memory limit Configured reports (durable, memory_limit) live in docs/benchmarks/configurations, are validated separately from the default reports and render as their own README sections. File-backed Doublets rows are compared with SQLite File Tuned where it was measured, the transactional store with SQLite File. benchmark_configuration.py plans the runs, probes the disk's random 4 KiB read and fsync latency, and records the cgroup limit, peak and major faults.
…n the PostgreSQL check, the unit_store_growth lockfile experiments/unit_store_growth depends on the rust crate, so its lockfile follows rusqlite 0.43.0.
doublets 0.21.0 grows its memory with grow_filled(Default), and FileMapped of platform-mem 0.4.0 writes the fill over the whole set_len extension, so a fresh 32-bit united store dirties 32 MiB of mapped pages before its first link: the 24 MiB memory-limit run was OOM-killed at 20,000 links. ZeroExtended reports the zero extension as initialized, so the reservation stays a hole. The configured workflow keeps the scope alive on an OOM kill and prints the cgroup stats before failing; os-release is read without sourcing it (SC2031).
…e_returning experiment to rusqlite 0.43.0 (RUSTSEC-2026-0459)
…figured benchmarks and the current upstream bugs in the READMEs
…ry plan, restored after the run)
… ratios of the limit The united store was killed under 24 MiB (run 45604850024): the kernel's thresholds, computed from the whole runner, let it dirty 21 MiB of its mapping before writeback throttled it. The thresholds are recorded in the reports and shown in the tables. The temporary plan now measures only the memory-limit runs; the durable jobs of run 45604850024 keep running.
… to SQLite File and SQLite File Tuned Measured on this pull request in run 45604850024 (32 and 64 bit, 10,000,000 links, --repetitions 1).
…reports into one table Under 24 MiB the united store had not finished after 91 minutes, so the three storages of a 1,000,000-link table, and certainly of a 10,000,000-link one, would exceed the job time limit together. The plan now gives each storage its own job; the report merges the jobs of one run into one table and shows each job's runner, disk latencies, peak cgroup memory and major page faults in a second table.
…rnel applies them to the cgroup Byte thresholds are scaled to a cgroup as a fraction of the runner's memory (domain_dirty_limits in mm/page-writeback.c), so the cgroup's own thresholds are a few pages under 24 MiB, not 20% of the limit. The plan step no longer masks a failure of the plan command.
… in the README example benchmark_report.py needs default reports, which a local results directory lacks.
…memory-limit tables SQLite reads its file with read, so its misses under the limit show as 0 major faults.
…he phases it finished The Doublets jobs under 24 and 240 MiB ran into the 355-minute job limit without a report. The benchmark now logs each measured phase as it begins and ends with --phases; scripts/memory_limit_run.sh runs it for at most 340 minutes inside the scope and samples the scope's wait channel, dirty and writeback pages, major faults and pressure every 15 minutes. A stopped run is reported by benchmark_configuration.py unfinished: the finished phases, a lower bound for the phase in progress and — for the rest, with a note under the table.
…ives its storage, and run the pull request plan when the runner script changes
…g byte thresholds, which the kernel scales down to a few pages for a cgroup
…hrottling counts the cgroup's own writeback pages
…ict_limit on its disk, which throttled the mapped stores to a crawl
… it in the provenance line
…lets stores under 24 MiB at 1M links and 240 MiB at 10M From the full plan of run 45689097621 on 326f6e1. No store was OOM-killed (memory.events max 0, oom_kill 0). SQLite File finished both tables; the Doublets stores were stopped after 340 minutes, and their rows keep the phases they finished and a lower bound for the phase in progress.
Working session summaryAll three requests of #127 are done, and PR #179 is marked ready for review: #179. CI passed on the final commit (a517546), the working tree is clean, The last piece was the memory-pressure tables, published from run 45689097621:
Their rows keep the phases they finished, show a lower bound (
The durable tables come from an earlier run, 45604850024. Since then the only Rust changes add the phase log, so what they measure is unchanged. The PR description now has this Validation section, plus notes on the 340-minute timeout, the phase log and the memory sampler, and still says "Fixes #127". This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $39.479171📊 Context and tokens usage:Claude Opus 5.5: (15 sub-sessions)
Total: (55.9K new + 1.6M cache writes + 71.3M cache reads) input tokens, 637.9K output tokens, $39.479171 cost 🤖 Models used:
📎 Log file uploaded as Repository (28014KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/5Reason: CI failures detected Evidence:
Starting a new session to address it. |
…mpler merge_jobs, a static Tuning property and no optional pragmas parameter
…lpers, the complex method CodeFactor reports at its first-seen lines 273-303
Working session summaryCodacy and CodeFactor now pass, along with all 34 other checks on the latest commit ( Codacy (12 new issues, all from earlier commits in this PR):
CodeFactor (1 complex method): CodeFactor kept showing the message it first recorded at commit 17a6478, the same "Complexity is 18 (lines 273-303)" across every later commit. At that commit, those lines were Local checks: the 92 Python tests pass, including the one that requires the committed READMEs to match the generator exactly. ruff, mypy and bandit are clean, and the C# solution builds with no warnings. No step needs a person to act. I added a "Static analysis" section about these fixes to the PR description. The issue's three requests and the comment about using the latest dependencies were already covered by earlier commits, and there was no new feedback on the issue or the PR. This summary was automatically extracted from the AI working session output. |
🔄 Auto-restart-until-mergeable Log 1/5This log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $1.619487📊 Context and tokens usage:
Total: (94 new + 68.8K cache writes + 2.5M cache reads) input tokens, 28.4K output tokens, $1.619487 cost 🤖 Models used:
📎 Log file uploaded as Repository (29908KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
|
The non-volatile Doublets rows were labelled as comparisons with SQLite of the same durability.
SQLite Filefsyncs its rollback journal and database at everyCOMMIT, while the mapped Doublets stores have no journal and never sync. This change measures the durable pairing the README claimed and gives SQLite a configuration that matches a fully mapped store. It also adds tables for the file-backed stores under memory pressure. The libraries are bumped to their latest releases, and the bugs in them that stand in the way of the closest comparison are reported upstream, each with a workaround in this repository.Fixes #127.
Changes
Request 1: the transactional Doublets row at 10M
Doublets_United_NonVolatile_Transactional(Rust, opt-inlinksvariant) puts the united file-mapped store behind doublets'TransactionsDecorator, with the shippedFileTransitionLog, which callssync_allafter every record.SQLite File(stock defaults,synchronous=FULL) in a new "Durable file storage" section at 10,000,000 links, 32 and 64 bit, with--repetitions 1.NonVolatilerows are now described as "file-backed without durability guarantees" in both READMEs.Request 2: SQLite's configuration
SQLite File Tunedrow runsPRAGMA cache_size = -1048576; PRAGMA mmap_size = 1073741824;before the schema is created.SQLite_File_Tuned) and in both C# providers (SQLite_File_Tunedon Microsoft.Data.Sqlite,SystemDataSQLite_File_Tunedon System.Data.SQLite).Request 3: memory pressure
SQLite_File,Doublets_United_NonVolatileandDoublets_Split_NonVolatile(32 bit) run inside asystemd-run --scopewithMemoryMax,MemorySwapMax=0and--repetitions 1:memory.peakand major page faults. The provenance line showsmemory.highand the dirty page thresholds.O_DIRECTrandom 4 KiB read latency and thefsynclatency.Pipeline
.github/workflows/configurations.ymlplans and runs the configured jobs.scripts/benchmark_configuration.pyprovidesplan,probe,recordandreport. The configured reports are kept indocs/benchmarks/configurationsand validated separately from the default reports, and the README sections are generated from them.minutes(a dispatch input, at most and by default 340), then stops it withtimeout. The benchmark's--phaseslog keeps the phases it finished, andbenchmark_configuration.py unfinishedturns that log into the store's report.scripts/memory_limit_run.shsamples the scope after a minute and then every 15 minutes: the benchmark's state and wait channel, its file, dirty and writeback pages, major faults, and memory and I/O pressure. At the end it writesmemory.peak,memory.statandmemory.events, which outlive an OOM kill.Latest dependencies
experiments/unit_store_growthandexperiments/split_store_deletepass on it.Npgsql.EntityFrameworkCore.PostgreSQL11.0.0 targets onlynet11.0, according to its NuGet catalog entry, so it stays at 10.0.3 onnet10.0.link-cliandlinks-notationare not used by this repository, so there is nothing to bump.Upstream bugs reported, with the workarounds kept here
grow_filledruns over aset_lenextension. That is 32 MiB of dirty pages per growth of a 32-bit united store, so the 24 MiB run was OOM-killed before its first measured link.rust/src/memory.rsZeroExtendedreports the extension as initialized, so the reservation stays a hole.USE_LIST) is unimplemented (todo!()). The Rust split store uses trees, unlike the C# default, and the READMEs say so.Delete(id)without a reset leaves stale index entries.Delete(id, handler: null).experiments/csharp_delete_minimalandexperiments/csharp_tree_deletereproduce the bug on 1.0.0.Memory-limit OOM root causes
The 24 MiB job was killed twice, for two different reasons. The kernel stats are in the job logs.
Zero-filled reservation (doublets-rs#95 above): the reservation was written over with zeros. Fixed by
ZeroExtended.mapped_stores_do_not_write_their_reservation_and_reopen_with_their_linkschecks on Linux that the reservation stays unallocated and that the store reopens with its links.Dirty and writeback pages that reclaim cannot free. Each setting below was tried in a dispatch of the 24 MiB, 1M-link table. The job logs have the scope samples and the final
memory.statandmemory.events.vm.dirty_ratio20%,vm.dirty_background_ratio10%oom_kill 1): 21.6 MiB of file pages, all dirty, 15.7 MiB under writeback.vm.dirty_bytesandvm.dirty_background_bytesat 20% and 10% of the limitbalance_dirty_pageswith I/O pressure and no memory pressure.vm.dirty_ratio5%,vm.dirty_background_ratio2%create: 23.3 MiB of file pages, all under writeback.strict_limiton the storage disk's bdibalance_dirty_pagesto about 3 MiB of file pages in 6 minutes, with no memory pressure.memory.highat 7/8 of the limit (kept)max 0,oom_kill 0), peak at most 21.8 MiB. All three stores run under memory pressure: the united store had 448,638 major faults in 6 minutes.domain_dirty_limitsinmm/page-writeback.cconverts byte thresholds into a ratio of the runner's available memory, rounded up to 1/4096 ("The byte settings can't be applied directly to memcg domains. Convert them to ratios by scaling against globally available memory."). It then applies that ratio to the memory the cgroup can use, so under 24 MiB the cgroup's thresholds came to a few pages. Earlier commits of this PR described the byte values as the cgroup's thresholds, which was wrong.balance_dirty_pagescompares the cgroup's dirty and writeback pages with its thresholds usingmem_cgroup_wb_stats. That function reads the memcg counters aftermem_cgroup_flush_stats_ratelimited(mm/memcontrol.c), and the counters are flushed every 2 s (FLUSH_TIME). In that window the united store, at about a microsecond per link, dirtied the whole limit. Reclaim cannot free pages under writeback, so the charge failed. This explanation comes from the kernel sources (v6.11) and the stats above. It was not confirmed with a kernel trace.memory.high: a task above it reclaims and sleeps on its way back to user space (mem_cgroup_handle_over_high), which gives the writeback time to finish beforememory.max. The limit staysmemory.max, andmemory.highis recorded in the report and shown in the provenance line.Reproduction and regression coverage
rust/tests/storages.rs):every_optional_links_variant_passes_the_lifecycleruns the tuned and transactional variants through the checked lifecycle.transactional_store_commits_one_transaction_per_written_phaseandtransactional_store_journals_writes_outside_a_phase_one_by_oneread the journal entries.mapped_stores_keep_their_links_when_their_memory_growsand the reservation test above cover growth.StoragesTests.cs):SQLiteVariantsAreRegisteredandTunedSQLiteFilesApplyThePragmasread the pragmas back from both providers.scripts/test_benchmark_configuration.py,scripts/test_benchmark_report.py) covers:SQLite Fileand duplicated durable reports;Run the configured benchmarks locally as described in README "Configured benchmarks". Regenerate the READMEs with:
Validation
Durable tables (run 45604850024):
main870ddc7, on an Intel Xeon 6975P-C runner, 32 and 64 bit.rust/src/harness.rsandrust/src/main.rs. They add the--phaseslog and leave the measured code as it was.SQLite File:Memory-limit tables (run 45689097621):
The full plan, dispatched on 326f6e1. The commits after it change only a docstring and publish the reports.
No store was killed. Every job's
memory.eventsshowsmax 0andoom_kill 0. Peaks were 21.2 to 21.7 MiB under 24 MiB, and 210.2 to 213.3 MiB under 240 MiB.SQLite Filefinished both tables: in 18 minutes at 1M links, and in 5 hours at 10M.The Doublets stores ran under real memory pressure: 21 to 56 million major page faults per job. Each was stopped after 340 minutes:
updatedeletecreatequery_by_from_toA stopped store's row keeps the phases it finished, gives a lower bound (
>) for the phase in progress and—for the rest, and a note under the table names it.The jobs ran on different runners: Intel Xeon 6975P-C, Xeon Platinum 8573C, AMD EPYC 7763 and EPYC 9V74. The second table under each limit lists every job's runner and the disk's random 4 KiB read and
fsynclatencies.Local checks on the final commit:
ruff format --checkandruff checkonscriptsandexperiments;mypy scriptsandbandit -r scripts experiments;dotnet buildof the C# solution;lizard: no function inscriptshas a cyclomatic complexity above 15;markdownlint-cli0.49.1 onREADME.md,README.ru.mdandCONTRIBUTING.md;scripts/ci_checks.py.Static analysis (Codacy, CodeFactor):
SQLiteStorage.Tuningis a static read-only property instead of aconst(Sonar S2339). Thepragmasconstructor parameter is required instead of optional (S2360); every caller already passed it.validate_configurationat 17a6478).validate_configuration,merge_jobs,plan,unfinishedandprovenanceare split into helpers, and the output is unchanged.The Rust, C#, Benchmarks, Configured benchmarks (smoke plan), CI quality and Dependency audit workflows run on the pull request.