You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Formal: close PASTA + prove 2 metrics end-to-end across C++/Python; add STATUS.md (#1080)
* Formal: prove PASTA (discrete) + copy volume end-to-end; add STATUS.md
Closes the two largest open gaps in the correctness map (README §6 boundary).
PoissonArrivals.lean — PASTA in discrete-time form, the analogue the effort
targeted. Models the horizon as M equal time slots; a Poisson arrival
conditioned on its count is uniform over the slots (order-statistics property).
Proves the landing probability on line ℓ equals ℓ's time fraction
(uniform_landing_eq_timeFraction), and that this realizes exactly the
trueFraction sampling law ProfilerCorrectness ASSUMES
(uniform_realizes_trueFraction). So the faithful-sampling hypothesis feeding
estimator_unbiased / jointVariance_eq is now discharged by the sampler
mechanism (via ExponentialSampler's Poisson result), not merely cited.
CopyVolumeWiring.lean — the first metric proven END TO END across the
C++/Python boundary. Models both the memcpysampler.hpp accumulator/flush state
machine and the process_memcpy_samples Python reader. Proves C++ conservation
(flushed = observed - residual), Python transfer faithfulness (mapfile + pid
filter neither drop nor dup in-process bytes), the round-trip conservation
headline (reported volume = observed - residual), foreign-pid drop, and a
residual bound of one sampling interval.
Both: no sorry, standard axioms only; full lake build green (8572 jobs).
STATUS.md — committed subsystem status map (proven / partial / unproven) so the
'where do we stand' view stays current. README gains §12 (PASTA) and §13 (copy
wiring) with source mappings; HANDOFF module table + next-steps updated (steps
4 and 7 now DONE).
* Formal: malloc footprint end-to-end (C++<->Python), incl. the free-side clamp
Third end-to-end metric across the native/Python boundary and the harder of
the memory paths: the current-footprint / peak-memory number. Spans the C++
SampleHeap emitter (sampleheap.hpp) and the Python reader
process_malloc_free_samples. The C++ half reuses MemorySampler's ThresholdSampler
(threshold_conserves) via a new emitter bridge.
The audit-method payoff: the Python free path clamps current_footprint to
max(0, current - count) on every free (memory_profiler.py:218), which BREAKS
pure conservation when frees outrun tracked allocs (startup misses). A naive
model ignoring the clamp would falsely 'prove' conservation. Instead:
- emit_records_sum: the records the C++ sampler emits sum (signed) to its
reported net -- bridge to threshold_conserves.
- clamp_is_identity_of_safe: while footprint stays >= 0 the clamp is inert and
the Python fold is exactly additive.
- roundtrip_conservation_of_safe (headline): in that regime, reported footprint
delta = (true net - sampler residual) / BYTES_PER_MB. End to end.
- clamp_only_raises: WITHOUT non-negativity, the clamp can only push the
footprint UP -- reported memory is never a silent undercount. Honest bound.
- foreign_pid_dropped, newline_marker_skipped: the pid filter and NEWLINE
continue faithfully drop non-counting records.
No sorry; standard axioms only. Full lake build green (8573 jobs). 14 modules /
114 theorems. STATUS.md §4b, README §14, HANDOFF updated.
* Formal docs: add 'why two engines' rationale (Lean vs TLC)
Pin down that Lean and TLA+/TLC are complementary, not redundant: Lean for
unbounded/quantitative correctness, TLC for bounded interleaving-existence
(counterexample traces) and liveness. Notes the one deliberate overlap
(LeakTrackerConcurrency assumes step-atomicity as an axiom) and that deriving
it from the sig-queue operational semantics is a natural TLA+ job. STATUS.md
gets a dedicated section; README's existing 'Why both?' note strengthened.
* Formal README: add subsystem proof roundup at the top
Replace the stale numbered intro list (1-9, predating PASTA, the two wiring
modules, leak-concurrency, and per-line attribution) with a current
narrative roundup by subsystem, marking each aspect proven/partial/unproven
with theorem names and section cross-refs. Points to STATUS.md for the
granular per-aspect table and to the numbered sections (now 1-14) for full
statements.
|`PerLineAttribution.lean`| per-line byte fraction faithful under sampling |`fraction_of_expectations`, `recorded_fraction_exact`|
85
+
|`PoissonArrivals.lean`|**PASTA (discrete)**: uniform arrival lands on ℓ with prob = ℓ's time fraction; realizes the assumed `trueFraction` sampling law → discharges the ProfilerCorrectness hypothesis |`uniform_landing_eq_timeFraction`, `uniform_realizes_trueFraction`, `sum_timeFraction`|
|`cppStep .copy n ℓ`|`incrementMemoryOps`: `_memcpyOps += n`| accumulate bytes, no trigger |
543
+
|`cppStep .copyFlush n ℓ`|`sample(n)` triggers → `writeCount()` emits `_memcpyOps`, then `_memcpyOps = 0`| flush accumulator to a record on line ℓ, reset |
544
+
|`Record.pid`|`getpid()` in `writeCount` (`snprintf``%d`) | records tagged with the emitting pid |
0 commit comments