Ashroot schema scale bench
This fixture measures uncompressed linked/prepared Wasm and executable Code
bytes as an application grows to 100 typed tables. Gzip is excluded from the
capacity budget. build.py records exact factory/SDK source, compiler, flags,
schema axes, actual Wire method/type counts and section sizes. Failed canonical
preparation retains linked-image evidence; that image is not a deployable
capacity result. Runtime instruction qualification uses separate host workloads.
Every selected table has reachable insert, replace, upsert, remove, bounded batch,
point-read, primary-page and score-index paths. Runtime table IDs select narrow
typed operations. Common dispatch and result work stay outside generic table
functions. inspect digests every actual row field; indexes(table) returns
entry counts and ordered digests for every ordinary and reverse index, bounded
to 4096 entries per index. The native tests independently derive and sort expected
entries from owned protocol records rather than invoking library projections.
Select exactly one table feature (tables0, tables1, tables10, tables25,
tables50, tables100) and one base index feature (indexes0, indexes4,
indexes8). relations adds a reverse foreign index per valid relation, beyond
the base index count. repeated shares one Rust row type; its absence declares
distinct row types cycling through six portable shapes. hylix and minima
select the engine; omit both for Nyxus. The empty database is an intercept
control. All engines retain the same logical workload.
Four base indexes cover descending score, unique name, country and composite country/score. Eight adds sparse score, unique external ID, flag/country and nested tuple keys. Rows use integer widths, bounded text, booleans and nested tuples. They own no external resources. Resource-owning payloads remain covered by the separate structural overhead bench.
Relations form four-table groups. The first can reference its cascade child;
the other three reference the first with Cascade, Restrict and SetNull. Default
seeding leaves the backlink absent. Explicit updates create a two-node cascade
cycle to test deduplication and row/edge bounds. Partial groups never reference
omitted tables. info reports the exact ordinary/reverse index counts.
V2 adds revision to the first table and changes Restrict children to Cascade.
Its converter copies actual stored fields into the new record, reindexes all
remaining tables, and validates the complete target graph in one continuous
root upgrade. It introduces no continuation messages or migration lockout.
The native upgrade test mutates source fields independently of the row factory,
then checks all rows and indexes. Actual IC upgrade qualification must use fresh
V1/V2 images from this same source generation and target/environment.
The common schema axis has seven workload methods and eight application Rust
DTOs. The published descriptor also contains the SDK's controller update.
Optional api10 or api100 adds 10 or 100 distinct methods and two distinct
request/response DTOs per method. These methods perform a point read plus payload
roundtrip, cycling six nested Wire shapes. This isolates method/DTO costs from
table-count costs. Every method reaches private storage and exposes an owned
protocol row. Native checks exercise every handler, encode/decode every DTO,
reject oversized Vec/text payloads, and verify declared counts against info.
Info.named_dtos counts distinct declared application Rust DTOs. API100 reports
208 even when several DTOs share the same Wire shape. Reports count workload
methods separately from all published methods, count publishedWireDefinitions
from each actual descriptor, and record declaredRustDtos from the source
declaration or runtime Info. Old receipts without a declared count report
it as unknown. Stable memory types never become public protocol records.
generate.py owns generated Rust files; this is a benchmark generator, not an
Ashroot product authoring layer. generate.py --check detects stale output.
Use the pinned compiler and private Cargo targets. Freeze a complete source
generation before canonical builds. In particular, an earlier frozen V1 fixture
is separate evidence and is not this generation's upgrade source.
source tools/env.sh
export CARGO_HOME="$HOME/.cargo"
export CARGO_TARGET_DIR="$PWD/benches/tmp/scale-native"
export TMPDIR="$PWD/benches/tmp/scale-temp"
mkdir -p "$TMPDIR"
python3 benches/ashroot-scale/generate.py --check
# opt0 is a native semantic screen, not a performance measurement.
CARGO_PROFILE_TEST_OPT_LEVEL=0 cargo test --lib \
--manifest-path benches/ashroot-scale/Cargo.toml \
--features tables100,indexes4,relations,api100 --offline --locked
Select the complete Cargo registry cache used by your checkout. Keep separate native and Wasm targets; reused compiler artifacts can retain another source root's proc-macro paths.
Build a fresh size cell with build.py --engine nyxus --tables 100 --indexes 4 --relations on --public-api 0 --versions v1 --output benches/ashroot-scale/tmp/size-100 --target-dir <exclusive-wasm-target>.
--public-api 10 or 100 selects the independent public-interface axis.
Aggregate explicit completed receipts with report.py --matrix benches/ashroot-scale/tmp/size-100/matrix.json --output benches/ashroot-scale/tmp/size-report. Repeat --matrix to add cells. The report
verifies canonical artifact hashes and actual section sizes, then emits JSON,
Markdown and CSV. Raw preparation failures remain visibly separate from prepared
modules. Table marginals require identical protocol, engine, index settings and
source generation; changing public DTOs cannot become a claimed table cost.
Definition counts are measurements, not evidence of protocol equivalence. Across
SDK optimizations, different counts may still describe equivalent methods; that
comparison requires an explicit proof of all logical method schemas, modes and
bounds plus complete encoded-payload byte equivalence. Table marginals retain
their strict source/SDK and complete-descriptor gates. No count-only exception
changes artifact verification, upgrade admission or those gates.
An unrun matrix cell is not a capacity, engine or migration claim. Normal application ownership and authoring rules remain in Ashroot's conventions.
The maintained IC calibration runner consumes a canonical matrix.json receipt
from this builder. It verifies every recorded build input/output, uses each
artifact's own SDK Wire codec and starts one owned server with the qualified
PocketIC binary. Frozen artifact/source directories must remain unchanged.
--source-root must match the artifact's actual canister source checkout.
Host helpers load beside the frozen runner and are receipted separately. Results must use a fresh directory outside this package.
# Install locked dependencies only in an owned private real directory.
# Never run npm ci through a shared node_modules symlink.
node --test benches/ashroot-scale/run.test.mjs
ASHROOT_SCALE_WIRE_TEST_ARTIFACT=/absolute/artifacts/v1/scale \
node --test benches/ashroot-scale/wire.test.mjs
env -u LD_LIBRARY_PATH -u LD_PRELOAD -u LD_AUDIT -u RRT_PIC_SERVER_URL \
CDK_RSX_BENCH_TMPDIR=/tmp node benches/ashroot-scale/run.mjs \
--source-root=/absolute/frozen-canister-source --artifacts=/absolute/cell/matrix.json \
--pocket-ic=/absolute/qualified/pocket-ic \
--output=/absolute/fresh-scale-results --population=100
The runner seeds every selected table in batches of100, verifies every primary page, score entry and available ordinary/reverse-index digest, then exercises CRUD and uniqueness in every table. It checks prefix batches, admission, Restrict, Cascade, SetNull, cycles and work budgets. Relationship mutation probes cover the first three row-family groups and highest related table position; initial FK writes and final reverse-index checks cover every declared relation. Optional public API methods receive actual Wire calls for every method and all six payload shapes. Each logical call records completed work and complete guest instruction charges separately from management debits and uncompressed Wasm bytes. Query/statistical inspection stays outside measured update windows.
A supplied matching V2 image receives exactly one KEEP upgrade. The runner
compares actual pre/post records and appends revision bytes to the actual old
first-table field digest; it then checks every table/index and the changed
relationship policy. There is no intermediate application migration protocol.
host-key-vectors.rs is a standalone native host probe, excluded from canister
modules; its frozen vectors cross-check JS digest math against actual Rust Key
encoders. Native tests and fake transports start no IC server.
The earlier six-method/seven-DTO capacity fixture remains supported with
CAPACITY_V1_ONLY coverage. Its absent public index digests and V2 converter are
reported as NOT_AVAILABLE. A new fixture without a V2 artifact reports
V1_ONLY; the empty control reports EMPTY_INTERCEPT_ONLY. A successful subset
never becomes a full migration or capacity claim. Actual run receipts list the
checks performed and unavailable capabilities.
The IC module hash identifies the exact submitted raw-or-gzip payload. The runner checks that hash separately and verifies gzip decompression equals the canonical prepared image. Only the uncompressed prepared bytes enter capacity results.