summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-15 11:31:50 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-15 11:31:50 +0300
commitacd338ea33de36d223cc6d301712eed4a9501e6c (patch)
treed93c46a97e2ed4e8a86e3402de5f847cdc144ec8 /docs
parentf97c3a585e2efc1d0a4bc10e6ac04b96ee6428ea (diff)
Fix snapshot storage and allocation failure correctness
Account for cluster records discarded by snapshot scrolling, propagate snapshot allocation failures with an empty retryable view, and allocate resized screens before mutating visible state. Add bounded-memory and allocation-failure regressions, and update the saved diagnostic and audit report.
Diffstat (limited to 'docs')
-rw-r--r--docs/correctness-audit.md20
1 files changed, 19 insertions, 1 deletions
diff --git a/docs/correctness-audit.md b/docs/correctness-audit.md
index bb85e24..4c9a14c 100644
--- a/docs/correctness-audit.md
+++ b/docs/correctness-audit.md
@@ -24,7 +24,7 @@ ASAN_OPTIONS=detect_leaks=0 build-audit/correctness-probe
`tests/correctness_probe.c` prints the observed behavior. It intentionally
includes `src/snapshot.c` to inspect its private arena counters and links
against the static library. It is a diagnostic, outside the default suite;
-exit status zero alone does not mean the findings have been fixed.
+it returns a nonzero status if any of the three findings still reproduces.
Leak detection was disabled because LeakSanitizer could not run in the audit
sandbox. Address and undefined-behavior checks remained enabled. To repeat
@@ -91,3 +91,21 @@ remain on row 3, and history should remain empty.
- Inject allocation failures and verify each API's documented failure state.
- Compare incremental snapshots with fresh captures, including grapheme text.
- Assert bounded storage during prolonged scrolling with a fixed viewport.
+
+## Fixes
+
+- Snapshot scroll accounting now counts discarded cluster records as dead,
+ allowing compaction to reclaim them.
+- Snapshot allocation failures now report false, empty the snapshot, and
+ force a complete capture on retry.
+- Height shrink allocates the replacement screen before moving rows or
+ changing the cursor, preserving state if allocation fails.
+
+Dedicated regression tests cover sustained scrolling, snapshot allocation
+failure and recovery, and failed height shrink on both normal and alternate
+screens. The output above records the original failures for reference.
+
+Validation after the fixes: all 43 unit test entries passed in an
+unsanitized debug build and all 43 passed with address and undefined-behavior
+sanitizers. The standalone probe also passed in both builds. Leak detection
+remained disabled in the sandbox.