()
| 91 | |
| 92 | |
| 93 | def main(): |
| 94 | if not os.path.exists(BINARY): |
| 95 | print(f"missing prod binary: {BINARY}\n build it: make -f Makefile.cbm cbm") |
| 96 | return 2 |
| 97 | base = tempfile.mkdtemp(prefix="cbm-832-") |
| 98 | repo = os.path.join(base, "repo") |
| 99 | os.makedirs(repo) |
| 100 | make_fixture(repo) |
| 101 | try: |
| 102 | inproc = run_series(repo, os.path.join(base, "c1"), supervised=False) |
| 103 | superv = run_series(repo, os.path.join(base, "c2"), supervised=True) |
| 104 | finally: |
| 105 | shutil.rmtree(base, ignore_errors=True) |
| 106 | |
| 107 | def mb(kb): |
| 108 | return kb / 1024.0 |
| 109 | |
| 110 | print(f"cycles={CYCLES} files={NUM_FILES}") |
| 111 | print("cycle | in-process(MB) | supervised(MB)") |
| 112 | for i in range(CYCLES): |
| 113 | print(f" {i:2d} | {mb(inproc[i]):8.1f} | {mb(superv[i]):8.1f}") |
| 114 | |
| 115 | ip_peak = max(mb(x) for x in inproc) |
| 116 | sv_peak = max(mb(x) for x in superv) |
| 117 | print(f"\nin-process peak resident: {ip_peak:8.1f} MB") |
| 118 | print(f"supervised peak resident: {sv_peak:8.1f} MB") |
| 119 | # The decisive, robust signal at laptop-fixture scale is the RESIDENT-LEVEL |
| 120 | # contrast, not cycle-over-cycle growth: the in-process server keeps the whole |
| 121 | # index working set resident (it never leaves the long-lived process), while |
| 122 | # the supervised path returns it every cycle (the child exits) -> the server |
| 123 | # stays near its idle baseline. The unbounded ratchet in the field (#832, GB |
| 124 | # over hours) is the same effect amplified by worker-thread count + cycle count |
| 125 | # beyond what a small fixture surfaces. Generous threshold; report-only, |
| 126 | # NON-GATING. |
| 127 | verdict = "SUPERVISED ISOLATION reproduced (server stays near baseline)" \ |
| 128 | if sv_peak < ip_peak / 2 \ |
| 129 | else "inconclusive (env-dependent; see numbers)" |
| 130 | print(f"verdict: {verdict}") |
| 131 | return 0 |
| 132 | |
| 133 | |
| 134 | if __name__ == "__main__": |
no test coverage detected