From 01001b9008182f8169b02016d5b6173beed9ce50 Mon Sep 17 00:00:00 2001 From: Kinneyzhang Date: Thu, 20 Aug 2026 07:58:44 +0800 Subject: [PATCH] perf: split append attribution --- .../change_post_audit_hardening_20260820.md | 12 ++++++++++ .../task_post_audit_hardening_20260820.md | 4 ++++ .../20260820-source-fresh-live-commit-gate.md | 5 +++++ tests/ekp-live-commit-evaluator.el | 22 +++++++++++++++++++ 4 files changed, 43 insertions(+) diff --git a/.phrase/phases/phase-kp-overhaul-20260726/change_post_audit_hardening_20260820.md b/.phrase/phases/phase-kp-overhaul-20260726/change_post_audit_hardening_20260820.md index bfad748..ab9d674 100644 --- a/.phrase/phases/phase-kp-overhaul-20260726/change_post_audit_hardening_20260820.md +++ b/.phrase/phases/phase-kp-overhaul-20260726/change_post_audit_hardening_20260820.md @@ -66,6 +66,18 @@ yet because the measured DP/append owners require an exact redesign. - **Commit:** `db6e6b9`. +## 2026-08-20 — Split append preparation, assembly, and DP timings + +- **Modify** the evaluator to time `ekp--append-para` and + `ekp--layout-plan-from-para` independently, fixing a wrapper-name collision + found by the first red run. +- **Evidence:** latest source-fresh candidate p95 is C append/append-DP + 16.953/1.015 ms and Elisp append/append-DP 71.896/55.970 ms; both engines + spend about 9.753 ms in append preparation and 5.663 ms in plan assembly. + The report remains red, raw JSONL is nonempty, and the wrapper itself now + passes the same matrix without argument errors. +- **Commit:** Pending measurement commit. + ## Verification - Source-first normal ERT: 295/295. diff --git a/.phrase/phases/phase-kp-overhaul-20260726/task_post_audit_hardening_20260820.md b/.phrase/phases/phase-kp-overhaul-20260726/task_post_audit_hardening_20260820.md index 4e93ad6..a8993c7 100644 --- a/.phrase/phases/phase-kp-overhaul-20260726/task_post_audit_hardening_20260820.md +++ b/.phrase/phases/phase-kp-overhaul-20260726/task_post_audit_hardening_20260820.md @@ -59,3 +59,7 @@ nonempty raw JSONL per run. Current source-fresh p95 is 17.161/1.187 ms for C append/append-DP and 73.293/57.063 ms for Elisp; choose a production optimization only after this attribution remains stable. + - It now also records append preparation/assembly separately: latest p95 + is 9.753/5.663 ms for both engines, while Elisp append-DP is 55.970 ms + and C append-DP is 1.015 ms. The evaluator wrapper collision was fixed and + the same source matrix passes the harness without argument errors. diff --git a/postmortem/20260820-source-fresh-live-commit-gate.md b/postmortem/20260820-source-fresh-live-commit-gate.md index 200c9c9..4075425 100644 --- a/postmortem/20260820-source-fresh-live-commit-gate.md +++ b/postmortem/20260820-source-fresh-live-commit-gate.md @@ -35,6 +35,11 @@ one-line optimization. A broad DP or projection rewrite would need a new red/green parity matrix and architecture decision; it is not smuggled into this measurement change. +The finer attribution separates the latest source-fresh append p95 into +`append_para`/`append_plan`: C 9.753/5.663 ms and Elisp 9.753/5.663 ms. The +Elisp `append_dp` remains 55.970 ms; C `append_dp` remains 1.015 ms. This is +why a C-only change cannot close the locked gate. + ## Consequences - `issue028` is closed as an evaluator-integrity defect. diff --git a/tests/ekp-live-commit-evaluator.el b/tests/ekp-live-commit-evaluator.el index dd9af01..d5adc2b 100644 --- a/tests/ekp-live-commit-evaluator.el +++ b/tests/ekp-live-commit-evaluator.el @@ -51,6 +51,8 @@ (defvar ekp-live-commit-evaluator--dp-ms 0.0) (defvar ekp-live-commit-evaluator--append-ms 0.0) (defvar ekp-live-commit-evaluator--append-dp-ms 0.0) +(defvar ekp-live-commit-evaluator--append-para-ms 0.0) +(defvar ekp-live-commit-evaluator--append-plan-ms 0.0) (defvar ekp-live-commit-evaluator--module-ms 0.0) (defvar ekp-live-commit-evaluator--install-ms 0.0) (defvar ekp-live-commit-evaluator--clear-ms 0.0) @@ -99,6 +101,8 @@ ekp-live-commit-evaluator--dp-ms 0.0 ekp-live-commit-evaluator--append-ms 0.0 ekp-live-commit-evaluator--append-dp-ms 0.0 + ekp-live-commit-evaluator--append-para-ms 0.0 + ekp-live-commit-evaluator--append-plan-ms 0.0 ekp-live-commit-evaluator--module-ms 0.0 ekp-live-commit-evaluator--install-ms 0.0 ekp-live-commit-evaluator--clear-ms 0.0 @@ -171,6 +175,8 @@ (para (symbol-function 'ekp--get-para)) (dp (symbol-function 'ekp--dp-cache-para)) (append-dp (symbol-function 'ekp--dp-cache-append)) + (append-para (symbol-function 'ekp--append-para)) + (append-layout (symbol-function 'ekp--layout-plan-from-para)) (module (symbol-function 'ekp-c-break-with-arrays)) (install (symbol-function 'ekp-buffer--install-live-prefix)) (suffix (symbol-function 'ekp-buffer--clear-live-suffix)) @@ -199,6 +205,12 @@ ((symbol-function 'ekp--dp-cache-append) (ekp-live-commit-evaluator--timed-wrapper 'ekp-live-commit-evaluator--append-dp-ms nil append-dp)) + ((symbol-function 'ekp--append-para) + (ekp-live-commit-evaluator--timed-wrapper + 'ekp-live-commit-evaluator--append-para-ms nil append-para)) + ((symbol-function 'ekp--layout-plan-from-para) + (ekp-live-commit-evaluator--timed-wrapper + 'ekp-live-commit-evaluator--append-plan-ms nil append-layout)) ((symbol-function 'ekp-c-break-with-arrays) (ekp-live-commit-evaluator--timed-wrapper 'ekp-live-commit-evaluator--module-ms @@ -257,6 +269,8 @@ (dp_ms . ,ekp-live-commit-evaluator--dp-ms) (append_ms . ,ekp-live-commit-evaluator--append-ms) (append_dp_ms . ,ekp-live-commit-evaluator--append-dp-ms) + (append_para_ms . ,ekp-live-commit-evaluator--append-para-ms) + (append_plan_ms . ,ekp-live-commit-evaluator--append-plan-ms) (module_ms . ,ekp-live-commit-evaluator--module-ms) (publication_ms . ,(+ ekp-live-commit-evaluator--install-ms @@ -489,6 +503,10 @@ baseline 'append_ms)) (append_dp . ,(ekp-live-commit-evaluator--statistics baseline 'append_dp_ms)) + (append_para . ,(ekp-live-commit-evaluator--statistics + baseline 'append_para_ms)) + (append_plan . ,(ekp-live-commit-evaluator--statistics + baseline 'append_plan_ms)) (module . ,(ekp-live-commit-evaluator--statistics baseline 'module_ms)) (publication @@ -509,6 +527,10 @@ candidate 'append_ms)) (append_dp . ,(ekp-live-commit-evaluator--statistics candidate 'append_dp_ms)) + (append_para . ,(ekp-live-commit-evaluator--statistics + candidate 'append_para_ms)) + (append_plan . ,(ekp-live-commit-evaluator--statistics + candidate 'append_plan_ms)) (module . ,(ekp-live-commit-evaluator--statistics candidate 'module_ms)) (publication