Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

bench: measure Phase 0 PG16.4 enforcement overhead (unstable local host) - #22

Draft
MrDarkRoot wants to merge 9 commits into
mainfrom
bench/phase0-enforcement-overhead
Draft

MrDarkRoot wants to merge 9 commits into
mainfrom
bench/phase0-enforcement-overhead

Conversation

@MrDarkRoot

Copy link
Copy Markdown
Owner

Scope

Refs #15. Adds a reproducible, disposable PG16.4 benchmark under benchmarks/phase0/ only. Baseline tables match protected columns, primary-key indexes, synthetic rows and restricted writer grants; existing C extension and protected triggers are built unchanged from experiments/native_tx_state/. Image digest pinned; trusted test budget 100 for 100-row transactions.

Invariant / Current Spec Reference

Research-only performance evidence for docs/test-plan.md §15 and docs/spec.md §13. No security assertion, policy scope or managed deployment claim is changed.

Relevant Canonical CC-* Tests

Existing full integrated security suite ran at measured implementation SHA 12375d3, exit 0; complete transcript archived. The original suite uses some legacy experiment IDs; this PR does not relabel them.

What Changed

Two complete measured runs, each 3 rounds × 200 transactions per accepted arm/case, 50 warmups; 1/5/100 subscription updates, individual users/refunds and mixed 3+2+2. Separate 30-trial protected denied cases. Raw CSVs, summary JSON (p50/p95/p99, TPS, rows/sec, variability), metadata and analysis: benchmarks/phase0/evidence/REPORT.md.

Security Impact / Adversarial Testing

Runner checks effect shapes, writer grants, durable state and rejected sticky-denial commits. Full existing suite passed at implementation SHA. One attempted repeat stopped on a missing denial message at transition trial 22; it was not counted as a passing run. A separate 100-trial diagnostic had 100 expected denials and no unauthorized durable state from a fresh admin; cause of the missing message is unknown.

PostgreSQL Semantics Considered

Only existing BEFORE UPDATE native C trigger graph is measured. Baseline has no trigger; the end-to-end difference includes trigger dispatch, callbacks, fixed-rule validation and the research fixture's server LOG lines, not isolated C accounting overhead.

Limitations / Unknowns

Draft for review: host throughput was unstable. In one complete run baseline 1-row TPS fell 1346 → 379 → 101 across rounds; 100-row paired TPS changes were −37%, +66%, −49%. Raw results are real but not a reliable general overhead estimate or PASS gate. Investigate host scheduling/I/O/contention and rerun on controlled hardware before interpreting overhead or tuning. Local PG16.4, one client only. No arbitrary PASS threshold.

Out-of-Scope Work Explicitly Not Included

No CI/demo changes, optimization, production performance or managed/cloud assertions, or broadening of supported SQL effects. No secrets; only fixture-only test credentials already present in the existing experiment.

  • I did not silently expand the support envelope.
  • Security-sensitive behavior has adversarial test coverage at the measured implementation SHA.
  • No secrets or non-fixture credentials are included.

Copy link
Copy Markdown
Owner Author

Maintainer review of PR #22 at HEAD 8c363b3fdbcf73901ca74d422c776bfb60345b8c: acceptable as an explicitly inconclusive research-data report, NOT ready for a performance-gate PASS or final #15 closure. Inspected benchmark code, local fixture isolation, the detailed report, raw-data file inventory and the archived 100-trial diagnostic. The two complete measured runs retain their real observations and separately classify denied transactions, but the enormous baseline rate drift and contradictory paired 100-row differences prevent reliable attribution to enforcement. The unsuccessful intervening repeat (transition trial 22 missing expected denial message) is transparently excluded; the subsequent 100-trial diagnostic showed expected denial and fresh-admin zero unauthorized durability but does not explain the missing-message event.

Follow-up required before accepting benchmark conclusions:

  1. Instrument a controlled reproduction that saves the complete per-trial combined psql output and SQLSTATE / fresh-admin state on error, including the failed case, before tearing down; distinguish an output/parsing issue from a real database semantic regression. Never weaken the sticky-denial assertion or silently retry it away. If a supported over-budget write is shown to durably commit, stop immediately with minimal repro.
  2. Rerun comparable alternating/randomized baseline/protected workload pairs on an adequately controlled/recorded host, with scheduling, CPU throttling, memory/IO, PostgreSQL/autovacuum and noisy-neighbor observations. Ensure new raw/summary provenance, repeat count and variation thresholds are defined before interpreting results; this is not a requirement to optimize the native extension.
  3. Preserve the current raw CSVs, both summaries and limitation language as inconclusive historical evidence. Publish a follow-up exact-SHA controlled run and a narrowly scoped amended report, or explicitly retain the task OPEN if a stable environment is not available.

Do not close Issue #15 or claim a reproducible overhead number. Do not alter shared run.sh, C enforcement, test budgets outside the disposable benchmark fixture or established security claims.

@MrDarkRoot

Copy link
Copy Markdown
Owner Author

Issue #15 follow-up at published measured implementation SHA 6ff8c929dea52d4671067f05765855f67c377075 (evidence-only commit / current draft PR head 8591ec6f5fdc4ac37ff836fd82ed2be428e4b8f6). Two predeclared balanced AB/BA runs completed sequentially: each 7,200 accepted transactions + 90 denied trials, 3 rounds/case, two 100-transaction pairs/round/arm, with all seeds and order recorded before interpretation. All 180/180 denied trials showed the expected SQLSTATE 54000, poisoned COMMIT rejection and fresh-admin protected/audit baselines; every per-trial SQL/output/server-log/admin-state record is archived. The historical trial-22 missing-message anomaly did not reproduce (both new trial-22 checks passed); its original cause remains unknown. The unchanged full native suite at the implementation SHA exited 0 with no harness skips under commitcap_bench_suite. Six pure methodology unit tests and both no-Docker plans passed.\n\nClassification remains INCONCLUSIVE: the predeclared within-run and between-run variability warnings triggered. In run 2 round 1, one 100-row baseline pair measured 26.86 TPS versus protected 89.29 TPS; IO-pressure telemetry rose during that pair, but root cause is not established. No stable overhead or product PASS claim; #15 remains OPEN and this PR DRAFT. New report with command sequence, metrics, limitations, compressed raw data/telemetry, 180 denial records, full suite transcript and reproducible unpack: https://github.com/MrDarkRoot/CommitCap/blob/8591ec6f5fdc4ac37ff836fd82ed2be428e4b8f6/benchmarks/phase0/evidence/followup-6ff8c92/REPORT.md ; checksums: https://github.com/MrDarkRoot/CommitCap/blob/8591ec6f5fdc4ac37ff836fd82ed2be428e4b8f6/benchmarks/phase0/evidence/followup-6ff8c92/manifest.json . Historical PR #22 evidence was not rewritten.

Copy link
Copy Markdown
Owner Author

Maintainer follow-up review at PR #22 HEAD a08984a75b9c9f26db7286cb8985cbb4ef4b7cbe: the requested benchmark investigation is materially improved and correctly classified STILL UNSTABLE / INCONCLUSIVE.

Verified on GitHub:

  • instrumentation commit 6ff8c929dea52d4671067f05765855f67c377075 is confined to benchmarks/phase0/;
  • evidence commit 8591ec6... archives separate run1/run2 raw data, summaries, telemetry, per-trial denial bundles, comparison output and a complete compressed full-security-suite transcript; the final head only corrects the outcome label;
  • both new benchmark runs record deterministic balanced pairing and predeclared reproducibility-warning criteria;
  • all 180 new denied trials observed expected UPDATE and poisoned-COMMIT rejection with fresh-admin baseline state; the historical missing-message trial did not reproduce and therefore remains unexplained rather than being silently dismissed;
  • the post-measurement unchanged native suite is reported exit 0 with no skips;
  • the predeclared warnings decisively trigger (including >20% baseline pair spread in 11/12 run/case cells and large cross-run drift), so no defensible enforcement-overhead estimate can be extracted from this host.

This PR is reviewable and useful as an inconclusive research-method/evidence artifact, but it does not satisfy Issue #15's Phase 0 benchmark gate and Issue #15 should remain OPEN. Do not turn these numbers into a product or performance claim. The next meaningful measurement needs a substantially quieter/controlled host (or equivalent dedicated runner) and should preserve the new anomaly-capture path. No shared security/enforcement change is warranted from the current evidence.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant