Fresh incoming ECDSA heap and scratch lane
The primary workload is 100 different incoming SEC1 public keys, compact ECDSA
signatures and client inverse hints in one update. Public-key parsing, complete
signature/hint validation, every table/constant construction, allocations and
cleanup belong to that call. No key or result prepared in an earlier update is
used. This private lane starts at 2df170de4dec228cd35971ee33481e3122b7d0fc.
Matched IC source rules
The selected server binary SHA256 is
6a9a75ad9b4551d2b0f4a0d954ffb8bd5bbd0ebc44ac00290679b06ad0b2f8e6.
Its preserved computation-catalog.json from the parent benchmark is the
binary-side rule receipt. Relevant local /srv/shared/ic source files match
the catalog's complete file hashes exactly:
| File | SHA256 |
|---|---|
rs/memory_tracker/src/deterministic.rs |
e9377f7f1585506be3bf76d33aaa38815b4fd2b0b9165249cec6cf2c096a546c |
rs/embedders/src/wasm_utils/instrumentation.rs |
da5f8f0637fe34d611755b5d89d6497458846aa15f8f9f148fa28318592c02da |
rs/embedders/src/wasm_executor.rs |
2a33e779141971322262ff5dbba2cb4d67a27b0362812801e060286dda09dd4f |
rs/config/src/embedders.rs |
6d19bdc0b804bcb0bb7c1aedfa7127b8e85230b633502dc2485ae561f5315412 |
rs/config/src/subnet_config.rs |
e168eb929b47908879c25267334fb7105be7239f18590875760f3e27508ac4d6 |
The local checkout is based on commit
ee8086a9773725fd1058832a9400297cf0990112 with local instrumentation changes.
The matching file hashes establish the rule correspondence; the Git revision
alone does not identify this binary's modified source.
deterministic.rs:341charges first access to each aligned 64 KiB heap region;:366charges first dirtying separately. The configured 5,000 per 4 KiB OS page yields 80,000 instructions per event. First writing a previously untouched region therefore costs 160,000. Repeated accesses in the same physical execution do not repeat that fee.deterministic.rs:181creates new false accessed/dirty bitmaps and:478constructs the tracker withPROT_NONEmemory. The embedder creates the tracker atwasmtime_embedder.rs:930. Later messages have fresh tracking; body-counter boundaries and ordinary Rust calls do not reset it. The same Wasmtime instance continues across DTS slices (wasm_executor.rs:1003).instrumentation.rs:530gives bulk memory operations static weight 100. Dynamic length is injected at:1560, passed at:1761and subtracted unchanged at:1197:memory.copyandmemory.fillcost one further instruction per byte. The catalog calls thisic.wasm.bulk_length.v1. Removing a page but adding a large copy is not automatically a whole-call win.- Logical read/write masks record successful original Wasm loads, stores and copy ranges independently of physical faults. Net before/after values miss same-value writes and write-then-restore; masks and dirty events must remain distinct. First-fault source identifies the opening operation, not every later user of that region.
embedders.rs:93sets the large dirty-copy threshold to 1 GiB. The 3,000 per dirty OS-page scheduler overhead is applied only after that optimization triggers (wasm_executor.rs:1027,1130). It is not an additional fee for each small scratch write or each table copy in this workload.
Fresh layout findings
The existing caller-owned G16/identity/GLV pool is a cached-key diagnostic. With its constructor inside a fresh call, constructing it must read linked constants and copy them into scratch during that call. Its old cached-message first-touch hypothesis is not a guaranteed fresh-call saving. A different resulting static layout could still change the set of required regions; only the new artifact's trace can establish that.
Rolling per-record native verification needs one transient prepared key/table, not 100 retained tables. Moving that scratch to a fresh heap region can add access/dirty events. The fresh Wire request's raw input, decoded item/key/signature vectors and verdict vectors also count in the whole update. This lane does not change the Wire schema, array-validation contract or SDK allocator to hide them.
The separate fresh batch-Q preparation candidate shares one coordinate-field inverse across 7*N nontrivial odd multiples, preserving N exact independent ECDSA equations. Its baseline workspace retains all projectives, all prefix products and all finished affine tables concurrently. Projective scratch is dead once a row's finished table is produced, giving a storage opportunity.
Fresh baseline evidence
The parent's actual incoming-Wire artifact SHA256 is
200500e8332521d0bc019da7a1de3136c9321433f679faa82b361a32717714df.
Its exported fresh-wire-baseline100-20261025 results contain 100 incoming
different people, with all parsing and constructor work inside the update:
| Compressed-key path | Request bytes | Whole instructions | Page instructions |
|---|---|---|---|
| Direct, ordinary inverse | 13,203 | 231,616,708 | 400,000 |
| Direct, client inverse hint | 16,403 | 214,796,464 | 720,000 |
| Rolling native, client hint | 16,403 | 234,079,931 | 720,000 |
| Rolling native Jacobian, client hint | 16,403 | 193,196,903 | 720,000 |
| Rolling native window eight, client hint | 16,403 | 181,393,407 | 800,000 |
The first ordinary direct profile and its unprofiled companion have identical whole-call instructions. Its reconciled complete ledger reports zero unexplained instructions, complete page details and independently truncated physical stacks. It accesses regions 16, 26 and 34 and dirties 16 and 34. The static-region first fault has an explicitly unmapped source PC; it cannot be assigned to one Rust line from neighboring PCs.
The hinted direct/native traces additionally access and dirty regions 32 and 35, exactly four events and 320,000 instructions. The 16,403-byte request is 19 bytes above the SDK Global allocator's 16,384-byte small-allocation limit. The larger request uses a direct page run, opening provider/control region 32 and a second runtime payload region 35. Both kinds of event are charged once; subsequent workspace claims in this call already share the opened provider region. This is a source-supported layout interpretation of the observed sets, not a proposal to change the SDK allocator or its threshold.
Page instructions are about 0.34% of the direct hinted call and 0.44% of the window-eight hinted call. The primary optimization remains arithmetic, while this lane tests narrower scratch/copy improvements without changing semantics.
Phase-overlapping candidate
PackedNativeVerificationBatchWorkspace<N> stores each key row as a safe enum:
Empty, Building { Q, projective[7] }, or Ready(native_table). Shared
prefixes[7*N] and the product remain separate. Every key is appended anew;
all tables are inaccessible until normalization completes. begin() invalidates
previous tables. There is no unsafe union, imported native coordinate format or
key/result cache. The global inversion, reverse Montgomery order, existing
odd-multiple formulas, beta images and verifier methods match the baseline.
Wasm64 release uses 120-byte projective points, 84-byte affine points and a 1,344-byte native table. The candidate has a compile-time 1,348-byte enum-row assertion. At N=100 the vendor scratch is 162,856 bytes, versus 246,456 bytes for the separate-array baseline; checked-equation rows add the same amount to both. This potentially crosses a four-region to three-region allocation boundary. It is a layout bound, not an observed region or fee result.
Constructing a finished table in a local temporary can add a 1,344-byte copy
per row: if emitted as 100 separate memory.copy operations, about 144,400
instructions for N=100, close to the 160,000 read/dirty fee of one region.
Conversely, the enum's default state initializes tags rather than eagerly
initializing both projective and affine payload arrays. The compiler may
eliminate or merge some copies/initializers. Large Box::new(Default::default())
constructors may also materialize scratch on the stack before moving it; that
can open additional stack regions. The actual emitted Wasm and complete profile
must settle the tradeoff.
The parent owns fresh canonical builds and PocketIC profiles. Compare matched N100 distinct-key calls with parsing, construction and cleanup timed, including compressed33 and uncompressed65 keys. Retain Native/Jacobian/window-eight separately and check every verdict. The initial qualification here is native parity only; no IC speed, page dominance or measured saving is claimed.
The packed wrapper reuses FreshEcdsaItem, FreshEcdsaArithmetic and the same
checked-equation decoder from prerequisite c7c9515f. Its capacity and malformed
input errors precede every output write, preserve the failing row index and
error order, and leave output suffixes unchanged. A live endpoint requiring
independent per-row errors must either report an honest admission abort or run
a fully timed all-row fallback; an early batch error is not 100 verdicts.
Four focused packed native tests passed with the pinned compiler, locked offline
dependencies, disabled debug information/incremental builds and -j4. They
cover 100 distinct keys over two generations, both SEC1 encodings, all three
arithmetic modes and both S policies; all 306 oracle records with correct and
malformed hints; partial admission failure at row 37 with unchanged outputs and
recovery; capacity, empty input, table visibility and zero/negative terms. The
native target occupies 26 MiB, below the 250 MiB lane budget. The combined vendor
patch reproduces all 54 integrated files from 47 checksum-verified imports.
The historical staged BIP340 N100 width-five screen paid 800,000 page instructions out of 190,265,043 total (about 0.42%). Historical cached ECDSA N1 paid 480,000. Neither is a fresh ECDSA N100 measurement or establishes that page fees dominate the new workload.