Commit graph mql5-tick-compression/tests
Author SHA1 Message Date
Claude Claude
4215e782e3 Remove committed Python bytecode and ignore it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 17:13:54 -08:00
Claude Claude
6b18a065ee Test the MetaTrader scripts end to end in an emulated terminal
mql2cpp.py now also translates scripts (input variables, D'...' date
literals) and mql5_shim.h emulates the terminal functions they use
(CopyTicksRange/CopyTicks over a loaded tick file, TimeToStruct,
custom symbols, Comment, captured Print output). test_scripts.cpp runs
TkzExport with day/week/month chunks and checks every chunk against
independent calendar periods, then TkzVerify, TkzToCustom (including a
re-import) and TkzSelfTest. Also fix the shim's ArrayResize reserve
semantics, which reallocated on every call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 17:06:47 -08:00
Claude Claude
7b1a9c4271 Reject corrupt chunks early, add fuzz test
A valid payload is consumed exactly, so reading past its end or leaving
bytes unread now fails the decode immediately instead of producing
garbage until the checksum check. Headers with an impossible tick count
for their payload size or a table larger than 2^24 are rejected before
any allocation. The fuzz test mutates header and payload bytes, sizes
and lengths and requires every accepted chunk to decode to the original
ticks. The format and encoder output are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:40:14 -08:00
Claude Claude
541e992bab Add tools to fetch benchmark tick samples and run baselines
fetch_samples.sh downloads four public tick samples (Dukascopy EURUSD
and XAUUSD, a broker XAUUSD feed, US500) from Hugging Face and converts
them with a small pure-Python Parquet reader. baselines.py measures
xz/zstd on raw and delta-encoded ticks for comparison.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:33:00 -08:00
Claude Claude
5409a8d316 Use a squash lookup table, add golden-output self-test
The hot path now reads Squash() from a precomputed table (byte-identical
output). The self-test encodes a deterministic data set and compares
size and FNV-1a hash with the reference C++ build, which catches any
MQL5 compiler difference that would make archives non-portable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:21:50 -08:00
Claude Claude
eab93a6655 Add MetaTrader scripts and in-terminal self-test
TkzExport writes the tick history of a symbol into a .tkz archive
(day/week/month chunks, optional per-chunk verification), TkzVerify
decodes an archive and compares it with the terminal history,
TkzToCustom loads an archive into a custom symbol, and TkzSelfTest runs
CTkzSelfTest (synthetic edge cases, real ticks, archive I/O). The
self-test class is also compiled and run by the C++ harness.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:16:49 -08:00
Claude Claude
b35aa8473a Harden MQL5 typing, add writer verification and append test
Make ternary branches and compound assignments type-exact for the MQL5
compiler, avoid names that clash with built-in functions (Symbol,
Digits), store min/max tick time per chunk for range queries, and let
CTkzWriter decode each chunk again and compare it with its input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:11:33 -08:00
Claude Claude
2f8ab68225 Add MQL5-to-C++ test harness for the codec
mql2cpp.py translates the MQL5 sources into C++, mql5_shim.h emulates
the MQL5 runtime (bounds-checked arrays, poisoned ArrayResize memory,
file API). test_codec.cpp runs synthetic edge cases, corruption checks,
archive tests and bit-exact round trips on real tick files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:07:23 -08:00