feat(core): add compact durable world storage and verified CLI
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
Checking shacraft-core v0.1.0 (/home/emil/Desktop/shacraft-core/crates/shacraft-core)
|
||||
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.29s
|
||||
Compiling shacraft-core v0.1.0 (/home/emil/Desktop/shacraft-core/crates/shacraft-core)
|
||||
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.46s
|
||||
Running unittests src/lib.rs (target/debug/deps/shacraft_core-20405a893c25a7e7)
|
||||
|
||||
running 11 tests
|
||||
test section::tests::direct_read_rejects_out_of_range_cell - should panic ... ok
|
||||
test section::tests::crc32_matches_standard_check_value ... ok
|
||||
test section::tests::packed_indices_match_cross_byte_wire_fixture ... ok
|
||||
test section::tests::uniform_round_trip_and_little_endian_layout ... ok
|
||||
test section::tests::invalid_palettes_and_indices_are_rejected ... ok
|
||||
test section::tests::structurally_invalid_headers_are_rejected_even_with_valid_checksum ... ok
|
||||
test section::tests::every_storage_mode_checks_registry_bounds ... ok
|
||||
test section::tests::dense_round_trip_and_size_crossover ... ok
|
||||
test section::tests::truncated_extra_and_corrupted_bytes_are_rejected ... ok
|
||||
test section::tests::palette_width_changes_at_powers_of_two ... ok
|
||||
test section::tests::every_palette_width_round_trips ... ok
|
||||
|
||||
test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s
|
||||
|
||||
Running tests/contract.rs (target/debug/deps/contract-fb06222454ea80ae)
|
||||
|
||||
running 8 tests
|
||||
test accepted_noop_advances_revision_and_prevents_undo_of_earlier_edit ... ok
|
||||
test edit_replay_precedes_revision_check_and_survives_reset_and_reopen ... ok
|
||||
test operation_id_collision_rejects_changed_payload_across_restart_and_methods ... ok
|
||||
test reset_is_monotonic_idempotent_durable_and_an_undo_barrier ... ok
|
||||
test invalid_batch_never_partially_writes_or_advances_revision ... ok
|
||||
test undo_restores_inherited_content_and_replays_without_mutating_newer_state ... ok
|
||||
test strict_undo_rejects_later_nonoverlapping_edits_and_aba_cycles ... ok
|
||||
test snapshots_pin_effective_source_contents_and_air_overrides ... ok
|
||||
|
||||
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
|
||||
|
||||
Running tests/storage.rs (target/debug/deps/storage-2b641b21f5b18d8e)
|
||||
|
||||
running 10 tests
|
||||
test registry_is_canonical_durable_and_rejects_malformed_identifiers ... ok
|
||||
test lock_is_exclusive_and_released_on_drop ... ok
|
||||
test corrupted_blob_is_reported_instead_of_air ... ok
|
||||
test revision_overflow_rejects_mutation_but_keeps_original_replay ... ok
|
||||
test explicit_gc_preserves_snapshots_history_and_cache_correctness ... ok
|
||||
test sqlite_failure_mid_edit_rolls_back_blobs_history_and_revision ... ok
|
||||
test oversized_unreachable_blob_is_rejected_before_reinterning ... ok
|
||||
test compact_cache_evicts_distinct_blobs_and_shares_identical_sections ... ok
|
||||
test coordinate_boundaries_and_inclusive_read_limits ... ok
|
||||
test uniform_section_remains_twenty_bytes_in_resident_cache ... ok
|
||||
|
||||
test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s
|
||||
|
||||
Running unittests src/main.rs (target/debug/deps/shacraft_tools-7c7bfbbbef840de7)
|
||||
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
|
||||
|
||||
Doc-tests shacraft_core
|
||||
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
|
||||
|
||||
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.05s
|
||||
{
|
||||
"passed": true,
|
||||
"checks": [
|
||||
"bounded resident cache with verified eviction while reading 80 sections",
|
||||
"second writer rejected while owner is running",
|
||||
"80 acknowledged edits and registry survive SIGKILL without flush",
|
||||
"idempotent replay after SIGKILL precedes current revision check",
|
||||
"invalid batch leaves both blocks and revision unchanged",
|
||||
"interrupted 32768-cell transaction is atomic (recovered revision 0)",
|
||||
"uncertain interrupted request can safely be retried",
|
||||
"invalid request does not terminate the local test session",
|
||||
"4096-cell uniform section occupies 20 encoded payload bytes in resident cache"
|
||||
],
|
||||
"final_metrics": {
|
||||
"process": {
|
||||
"peak_rss_bytes": 8237056,
|
||||
"rss_bytes": 8237056,
|
||||
"source": "/proc/self/status (null when unavailable)"
|
||||
},
|
||||
"storage": {
|
||||
"cache_capacity_sections": 2,
|
||||
"cache_entries": 1,
|
||||
"cache_evictions": 0,
|
||||
"cache_hits": 0,
|
||||
"cache_misses": 1,
|
||||
"cache_payload_bytes": 20,
|
||||
"cache_representation": "encoded_uniform_palette_dense",
|
||||
"commits_this_handle": 0,
|
||||
"coordinate_limit": 30000000,
|
||||
"database_bytes": 647168,
|
||||
"history_change_count": 36944,
|
||||
"history_retention": "all_operations_until_explicit_future_retention_policy",
|
||||
"immutable_blob_count": 18,
|
||||
"last_mutation_duration_us": 0,
|
||||
"max_edit_cells": 32768,
|
||||
"max_read_volume": 262144,
|
||||
"operation_count": 82,
|
||||
"os_rss_bytes": null,
|
||||
"overlay_section_count": 97,
|
||||
"registry_count": 2,
|
||||
"registry_limit_states": 262144,
|
||||
"registry_text_bytes": 32,
|
||||
"schema_version": 1,
|
||||
"shm_bytes": 32768,
|
||||
"snapshot_count": 0,
|
||||
"sqlite_cache_budget_bytes": 4194304,
|
||||
"sqlite_journal_mode": "wal",
|
||||
"sqlite_synchronous": "FULL",
|
||||
"transient_decoded_payload_peak_estimate_bytes": 16384,
|
||||
"wal_bytes": 0,
|
||||
"world_count": 3,
|
||||
"world_limit": 10000
|
||||
}
|
||||
},
|
||||
"limits": [
|
||||
"process crash tested; power loss and faulty hardware are not simulated",
|
||||
"storage-only workload; no Paper or gameplay performance comparison"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"edit": {
|
||||
"changed": 1,
|
||||
"replayed": false,
|
||||
"revision": 1
|
||||
},
|
||||
"metrics": {
|
||||
"process": {
|
||||
"peak_rss_bytes": 6131712,
|
||||
"rss_bytes": 6131712,
|
||||
"source": "/proc/self/status (null when unavailable)"
|
||||
},
|
||||
"storage": {
|
||||
"cache_capacity_sections": 64,
|
||||
"cache_entries": 2,
|
||||
"cache_evictions": 0,
|
||||
"cache_hits": 3,
|
||||
"cache_misses": 2,
|
||||
"cache_payload_bytes": 1076,
|
||||
"cache_representation": "encoded_uniform_palette_dense",
|
||||
"commits_this_handle": 8,
|
||||
"coordinate_limit": 30000000,
|
||||
"database_bytes": 77824,
|
||||
"history_change_count": 1026,
|
||||
"history_retention": "all_operations_until_explicit_future_retention_policy",
|
||||
"immutable_blob_count": 2,
|
||||
"last_mutation_duration_us": 99,
|
||||
"max_edit_cells": 32768,
|
||||
"max_read_volume": 262144,
|
||||
"operation_count": 4,
|
||||
"os_rss_bytes": null,
|
||||
"overlay_section_count": 4,
|
||||
"registry_count": 2,
|
||||
"registry_limit_states": 262144,
|
||||
"registry_text_bytes": 27,
|
||||
"schema_version": 1,
|
||||
"shm_bytes": 32768,
|
||||
"snapshot_count": 1,
|
||||
"sqlite_cache_budget_bytes": 4194304,
|
||||
"sqlite_journal_mode": "wal",
|
||||
"sqlite_synchronous": "FULL",
|
||||
"transient_decoded_payload_peak_estimate_bytes": 32768,
|
||||
"wal_bytes": 0,
|
||||
"world_count": 3,
|
||||
"world_limit": 10000
|
||||
}
|
||||
},
|
||||
"reset": {
|
||||
"changed": 0,
|
||||
"replayed": false,
|
||||
"revision": 3
|
||||
},
|
||||
"scenario": "shared floor -> isolated edit -> undo -> reset",
|
||||
"undo": {
|
||||
"changed": 1,
|
||||
"replayed": false,
|
||||
"revision": 2
|
||||
},
|
||||
"worlds": [
|
||||
{
|
||||
"name": "arena_a",
|
||||
"revision": 3,
|
||||
"template": "template"
|
||||
},
|
||||
{
|
||||
"name": "arena_b",
|
||||
"revision": 0,
|
||||
"template": "template"
|
||||
},
|
||||
{
|
||||
"name": "template",
|
||||
"revision": 1,
|
||||
"template": null
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
{
|
||||
"after_access_edit_reset": {
|
||||
"process": {
|
||||
"peak_rss_bytes": 7471104,
|
||||
"rss_bytes": 7471104,
|
||||
"source": "/proc/self/status (null when unavailable)"
|
||||
},
|
||||
"storage": {
|
||||
"cache_capacity_sections": 8,
|
||||
"cache_entries": 8,
|
||||
"cache_evictions": 249,
|
||||
"cache_hits": 299,
|
||||
"cache_misses": 257,
|
||||
"cache_payload_bytes": 4304,
|
||||
"cache_representation": "encoded_uniform_palette_dense",
|
||||
"commits_this_handle": 558,
|
||||
"coordinate_limit": 30000000,
|
||||
"database_bytes": 1343488,
|
||||
"history_change_count": 65380,
|
||||
"history_retention": "all_operations_until_explicit_future_retention_policy",
|
||||
"immutable_blob_count": 257,
|
||||
"last_mutation_duration_us": 108,
|
||||
"max_edit_cells": 32768,
|
||||
"max_read_volume": 262144,
|
||||
"operation_count": 456,
|
||||
"os_rss_bytes": null,
|
||||
"overlay_section_count": 256,
|
||||
"registry_count": 2,
|
||||
"registry_limit_states": 262144,
|
||||
"registry_text_bytes": 27,
|
||||
"schema_version": 1,
|
||||
"shm_bytes": 32768,
|
||||
"snapshot_count": 1,
|
||||
"sqlite_cache_budget_bytes": 4194304,
|
||||
"sqlite_journal_mode": "wal",
|
||||
"sqlite_synchronous": "FULL",
|
||||
"transient_decoded_payload_peak_estimate_bytes": 32768,
|
||||
"wal_bytes": 0,
|
||||
"world_count": 101,
|
||||
"world_limit": 10000
|
||||
}
|
||||
},
|
||||
"after_forks": {
|
||||
"process": {
|
||||
"peak_rss_bytes": 7446528,
|
||||
"rss_bytes": 7446528,
|
||||
"source": "/proc/self/status (null when unavailable)"
|
||||
},
|
||||
"storage": {
|
||||
"cache_capacity_sections": 8,
|
||||
"cache_entries": 0,
|
||||
"cache_evictions": 0,
|
||||
"cache_hits": 0,
|
||||
"cache_misses": 0,
|
||||
"cache_payload_bytes": 0,
|
||||
"cache_representation": "encoded_uniform_palette_dense",
|
||||
"commits_this_handle": 358,
|
||||
"coordinate_limit": 30000000,
|
||||
"database_bytes": 1331200,
|
||||
"history_change_count": 65280,
|
||||
"history_retention": "all_operations_until_explicit_future_retention_policy",
|
||||
"immutable_blob_count": 256,
|
||||
"last_mutation_duration_us": 44,
|
||||
"max_edit_cells": 32768,
|
||||
"max_read_volume": 262144,
|
||||
"operation_count": 256,
|
||||
"os_rss_bytes": null,
|
||||
"overlay_section_count": 256,
|
||||
"registry_count": 2,
|
||||
"registry_limit_states": 262144,
|
||||
"registry_text_bytes": 27,
|
||||
"schema_version": 1,
|
||||
"shm_bytes": 32768,
|
||||
"snapshot_count": 1,
|
||||
"sqlite_cache_budget_bytes": 4194304,
|
||||
"sqlite_journal_mode": "wal",
|
||||
"sqlite_synchronous": "FULL",
|
||||
"transient_decoded_payload_peak_estimate_bytes": 32768,
|
||||
"wal_bytes": 1095952,
|
||||
"world_count": 101,
|
||||
"world_limit": 10000
|
||||
}
|
||||
},
|
||||
"after_template": {
|
||||
"process": {
|
||||
"peak_rss_bytes": 7442432,
|
||||
"rss_bytes": 7442432,
|
||||
"source": "/proc/self/status (null when unavailable)"
|
||||
},
|
||||
"storage": {
|
||||
"cache_capacity_sections": 8,
|
||||
"cache_entries": 0,
|
||||
"cache_evictions": 0,
|
||||
"cache_hits": 0,
|
||||
"cache_misses": 0,
|
||||
"cache_payload_bytes": 0,
|
||||
"cache_representation": "encoded_uniform_palette_dense",
|
||||
"commits_this_handle": 258,
|
||||
"coordinate_limit": 30000000,
|
||||
"database_bytes": 1232896,
|
||||
"history_change_count": 65280,
|
||||
"history_retention": "all_operations_until_explicit_future_retention_policy",
|
||||
"immutable_blob_count": 256,
|
||||
"last_mutation_duration_us": 675,
|
||||
"max_edit_cells": 32768,
|
||||
"max_read_volume": 262144,
|
||||
"operation_count": 256,
|
||||
"os_rss_bytes": null,
|
||||
"overlay_section_count": 256,
|
||||
"registry_count": 2,
|
||||
"registry_limit_states": 262144,
|
||||
"registry_text_bytes": 27,
|
||||
"schema_version": 1,
|
||||
"shm_bytes": 32768,
|
||||
"snapshot_count": 0,
|
||||
"sqlite_cache_budget_bytes": 4194304,
|
||||
"sqlite_journal_mode": "wal",
|
||||
"sqlite_synchronous": "FULL",
|
||||
"transient_decoded_payload_peak_estimate_bytes": 32768,
|
||||
"wal_bytes": 1095952,
|
||||
"world_count": 1,
|
||||
"world_limit": 10000
|
||||
}
|
||||
},
|
||||
"comparison": "no Paper baseline measured",
|
||||
"elapsed_ms": 257,
|
||||
"fork_ms": 5,
|
||||
"forked_worlds": 100,
|
||||
"scenario": "storage-only; no players, rendering or tick simulation",
|
||||
"sections": 256,
|
||||
"seed_ms": 201,
|
||||
"environment": {
|
||||
"system": "Linux",
|
||||
"kernel": "7.0.0-31-generic",
|
||||
"arch": "x86_64",
|
||||
"rust": "rustc 1.96.0 (ac68faa20 2026-05-25)",
|
||||
"build": "release",
|
||||
"date": "2026-09-14"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user