Skip to content

tests: CR-150 flat-memory red acceptance tests (l4-pending) - #408

Draft
luisleo526 wants to merge 5 commits into
mainfrom
core/cr150-l0-red-tests
Draft

luisleo526 wants to merge 5 commits into
mainfrom
core/cr150-l0-red-tests

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

CR-150 (engine 1.7.0 flat memory), lane L0: the red acceptance tests of the design (section 7, (a)-(k)), written before any implementation.

  • C++ tests are labelled l4-pending;slow;mem, so CI excludes them until their lanes land (scripts/test_ci_verify.py --exclude-label l4-pending).
  • tests/flat_memory_rss_e2e.py drives the installed run_json + engine and measures "the rest" (RSS minus OHLCV) at 1k/100k/1M bars and at 10 vs 10k trades.
  • tests/flat_memory_spot_bigdata.sh runs a dataset larger than the box RAM on AWS spot.
  • scripts/check_report_sink_identity.py checks the byte identity of the streamed report.
  • Includes a test that fails if run_json releases a borrowed symbol-feed array before the run ends.

Each test fails today for the right reason (memory grows, or the sink API does not exist yet). The red runs happen on lab/spot; nothing ran on a Mac. Draft until the red evidence and a gating read are in.

🤖 Generated with Claude Code

luisleo526 and others added 5 commits October 18, 2026 06:48
Add the L0 fixture sources of DESIGN.md section 7: every_k, xsym and
scale_out, plus the two F13 fixtures (avg_trade_prefix and
selected_open_at_end). The flat-memory acceptance runs build their modules
with the release-shaped recipe; no engine code changes.

Co-Authored-By: Claude Code <noreply@anthropic.com>
test_report_sink_flat_heap (a'), test_report_sink_metrics (d) and
test_report_sink_format (i) are written against the 1.7.0 report sink and
fail to compile on this base: pineforge/report_sink.h,
src/report_sink_writer.hpp, src/sha256.hpp and src/report_scratch.hpp do not
exist yet. That first diagnostic is the recorded fail-before.

tests/CMakeLists.txt registers them, and the RSS row, only under
PINEFORGE_BUILD_FLAT_MEMORY_TESTS=ON with labels l4-pending;slow;mem, so
the current CI build and its ctest floors are unchanged.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Acceptance (a), (b), (f), (g), (h), (j) and the INPUTS item 1 borrowed-feed
guard. Peak RSS comes from os.wait4 ru_maxrss of the real run_json child,
minus every mapped OHLCV byte. Red on the base on the stated slopes; the
borrowed guard fails because the export does not exist and run_json clears
the feed arrays before the run.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Acceptance (d) corpus half and the Python half of (i): sink off vs on over
every probe (metrics bit for bit, every E/T value, CSV vs .bin), plus the
trailer-vs-hashlib, truncation and -nan self-checks. Exits 1 on this base
because strategy_set_report_sink_v1 and --report-sink do not exist.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Acceptance (c): 100M synthetic bars with --ohlcv-bin and --report-sink on a
2 GiB spot box, compared against a large-box masked summary and sink sha256.
Falls back to the CSV path on this base, where the loader holds about 300 B
per bar and the run is OOM-killed. Spot only, not a ctest row.

Co-Authored-By: Claude Code <noreply@anthropic.com>
return

sink_path = work / "format.sink"
document = json.loads(run_json(
import argparse
import hashlib
import json
import os
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