MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / stream_matches_single_pass

Function stream_matches_single_pass

tests/test_cypher.c:5881–5896  ·  view source on GitHub ↗

True when every chunk size reproduces the single-pass result, which is * left in *ref for the caller's own checks (caller frees). */

Source from the content-addressed store, hash-verified

5879/* True when every chunk size reproduces the single-pass result, which is
5880 * left in *ref for the caller's own checks (caller frees). */
5881static bool stream_matches_single_pass(cbm_store_t *s, const char *query, int max_rows,
5882 cbm_cypher_result_t *ref) {
5883 static const int chunks[] = {1, 7, 64, 0 /* production default */};
5884 int ref_rc = stream_run(s, query, max_rows, INT_MAX, ref);
5885 bool same = ref_rc == 0;
5886 for (size_t i = 0; same && i < sizeof(chunks) / sizeof(chunks[0]); i++) {
5887 cbm_cypher_result_t got;
5888 int rc = stream_run(s, query, max_rows, chunks[i], &got);
5889 same = rc == ref_rc && stream_results_equal(ref, &got);
5890 if (!same) {
5891 printf(" chunk %d differs from the single pass: %s\n", chunks[i], query);
5892 }
5893 cbm_cypher_result_free(&got);
5894 }
5895 return same;
5896}
5897
5898/* Every pipeline consumer across chunk boundaries: unsorted rows, global and
5899 * grouped aggregates (groups fed from many chunks), DISTINCT, late WHERE,

Callers 1

test_cypher.cFile · 0.85

Calls 3

stream_runFunction · 0.85
stream_results_equalFunction · 0.85
cbm_cypher_result_freeFunction · 0.85

Tested by

no test coverage detected