vomebook commited on
Commit ·
4eac8a3
1
Parent(s): 794135c
Harden Space benchmark corpus and temporary storage
Browse filesFiles changed (3)
1234567891011121314151681 unmodified lines989910010110210319 unmodified lines12312412512612712860 unmodified lines1891901911921931944 unmodified lines19920020120220320412 unmodified lines21721821922022122222322422522622718 unmodified lines246247248249250251252253254255"""Opt-in local Space search-order compute benchmark, with verified input.Obtain the expected identity independently (or inspect a trusted local copy viapython -m scripts.search_data_config DIRECTORY), then run from any directory:python -B scripts/benchmarks/benchmark_search_compute.py \--data-dir DIRECTORY --generation EXPECTED_SHA256 --iterations 7The directory must remain immutable throughout the run. The selector checksmanifest identity and all Space members, but does not authenticate their originor prove every posting's semantics. No data or book bodies are fetched orwritten. The generation's parent must be writable for Jieba's private,temporary dictionary cache, which is discarded afterwards.Each query has one untimed warmup and 1-100 timed warm in-process uncachedorders, in fixed order. This bypasses response/order caches, pagination, API81 unmodified linesif manifest_path.read_bytes() != manifest_bytes:raise ValueError("generation manifest changed during verification")files: dict[str, dict[str, object]] = manifest["files"]["space"]return selected, manifest_bytes, files19 unmodified linesraise RuntimeError(f"generation member changed during benchmark: {name}")def configure_paths(root: Path) -> None:"""Match all generation-owned paths selected by search_runtime_entry."""from backend import app60 unmodified linesparser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)parser.add_argument("--data-dir", type=Path, required=True, help="immutable materialized Space generation")parser.add_argument("--generation", required=True, help="independently expected generation SHA-256")parser.add_argument("--iterations", type=int, default=7, help="timed iterations per query, 1-100")options = parser.parse_args(argv)if not 1 <= options.iterations <= 100:4 unmodified linesdef main(argv: Sequence[str] | None = None) -> int:options = parse_args(argv)selected, manifest, files = select_generation(options.data_dir, options.generation)sources = source_hashes()# Application import mounts static files relative to the checkout root.os.chdir(ROOT)12 unmodified linesnative_sha = sha256_file(native_file) if native_file is not None else Noneconfigure_paths(selected.directory)require_paths(selected)# Resolve an existing parent without gettempdir()'s write probe, and pass# it explicitly to TemporaryDirectory so no writes touch the generation.temp_root = selected.directory.parentif temp_root == selected.directory or temp_root.is_relative_to(selected.directory):raise RuntimeError("temporary cache directory must be outside selected generation")with tempfile.TemporaryDirectory(prefix="space-bench-jieba-", dir=temp_root) as cache_dir:app.jieba.dt.tmp_dir = cache_dir# A missing word index would otherwise be rebuilt silently by load_data.18 unmodified lines"scope": "warm in-process uncached search orders; fixed query order, one untimed warmup per query; ""no response/order cache, API, executor queue, HTTP, network, browser or rendering; ""not production latency, a comparison, or an independent correctness oracle","input_assurance": "manifest and all Space files verified; identity is not authenticated provenance; ""index format/corpus linkage checked, full posting semantics not independently proven; ""directory must remain immutable during run","generation": selected.generation,"data_dir": str(selected.directory),"manifest_sha256": hashlib.sha256(manifest).hexdigest(),"space_files": files,123456789101112131415161781 unmodified lines9910010110210310410510610710810911011111219 unmodified lines13213313413513613713813914014114214314414514614760 unmodified lines2082092102112122132144 unmodified lines21922022122222322422522622712 unmodified lines24024124224324424518 unmodified lines264265266267268269270271272273274275"""Opt-in local Space search-order compute benchmark, with verified input.Obtain the expected identity independently (or inspect a trusted local copy viapython -m scripts.search_data_config DIRECTORY), then run outside the data directory:python -B scripts/benchmarks/benchmark_search_compute.py \--data-dir DIRECTORY --generation EXPECTED_SHA256 --temp-dir LOCAL_TMP --iterations 7The directory must remain immutable throughout the run. The selector checksmanifest identity and all Space members, but does not authenticate their originor prove every posting's semantics. It compares only the declared Pages corpushash and length, not Pages files or deployment. No data or book bodies are fetchedor written. A private Jieba cache is created under the explicitly provided localwritable temporary directory, outside the generation, and discarded afterwards.Each query has one untimed warmup and 1-100 timed warm in-process uncachedorders, in fixed order. This bypasses response/order caches, pagination, API81 unmodified linesif manifest_path.read_bytes() != manifest_bytes:raise ValueError("generation manifest changed during verification")files: dict[str, dict[str, object]] = manifest["files"]["space"]pages_files = manifest["files"].get("pages")pages_corpus = pages_files.get("search_data.json.gz") if isinstance(pages_files, dict) else Nonespace_corpus = files["search_data.json.gz"]if (not isinstance(pages_corpus, dict) or set(pages_corpus) != {"sha256", "bytes"}or type(pages_corpus.get("bytes")) is not intor pages_corpus.get("bytes") != space_corpus["bytes"]or pages_corpus.get("sha256") != space_corpus["sha256"]):raise ValueError("Pages and Space declared corpus hash or size mismatch")return selected, manifest_bytes, files19 unmodified linesraise RuntimeError(f"generation member changed during benchmark: {name}")def cache_parent(directory: Path, selected: SelectedGeneration) -> Path:"""Resolve an existing caller-selected temporary root without a write probe."""root = directory.resolve(strict=True)if not root.is_dir():raise ValueError("temporary cache root must be an existing directory")if root == selected.directory or root.is_relative_to(selected.directory):raise ValueError("temporary cache directory must be outside selected generation")return rootdef configure_paths(root: Path) -> None:"""Match all generation-owned paths selected by search_runtime_entry."""from backend import app60 unmodified linesparser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)parser.add_argument("--data-dir", type=Path, required=True, help="immutable materialized Space generation")parser.add_argument("--generation", required=True, help="independently expected generation SHA-256")parser.add_argument("--temp-dir", type=Path, required=True, help="writable local temp root outside generation")parser.add_argument("--iterations", type=int, default=7, help="timed iterations per query, 1-100")options = parser.parse_args(argv)if not 1 <= options.iterations <= 100:4 unmodified linesdef main(argv: Sequence[str] | None = None) -> int:options = parse_args(argv)selected, manifest, files = select_generation(options.data_dir, options.generation)temp_root = cache_parent(options.temp_dir, selected)if Path.cwd().resolve().is_relative_to(selected.directory):raise ValueError("current directory must be outside selected generation")sources = source_hashes()# Application import mounts static files relative to the checkout root.os.chdir(ROOT)12 unmodified linesnative_sha = sha256_file(native_file) if native_file is not None else Noneconfigure_paths(selected.directory)require_paths(selected)with tempfile.TemporaryDirectory(prefix="space-bench-jieba-", dir=temp_root) as cache_dir:app.jieba.dt.tmp_dir = cache_dir# A missing word index would otherwise be rebuilt silently by load_data.18 unmodified lines"scope": "warm in-process uncached search orders; fixed query order, one untimed warmup per query; ""no response/order cache, API, executor queue, HTTP, network, browser or rendering; ""not production latency, a comparison, or an independent correctness oracle","input_assurance": "manifest and all Space files verified; Pages corpus hash and size compared as ""manifest declarations only; Pages files and deployment not verified; identity is not ""authenticated provenance; full posting semantics not independently proven; ""directory must remain immutable during run","generation": selected.generation,"pages_corpus_declaration_matches_space": True,"data_dir": str(selected.directory),"manifest_sha256": hashlib.sha256(manifest).hexdigest(),"space_files": files,
123 unmodified lines124125126127128129130123 unmodified lines},"tests/performance/test_search_compute_benchmark.py": {"kind": "direct","source": "Dockerfile"},"tests/proxy/test_async_proxy.py": {"kind": "direct",123 unmodified lines124125126127128129130123 unmodified lines},"tests/performance/test_search_compute_benchmark.py": {"kind": "direct","source": "@reader-workflow"},"tests/proxy/test_async_proxy.py": {"kind": "direct",
20 unmodified lines2122232425261 unmodified line282930313233344 unmodified lines39404142434411 unmodified lines56575859606162636465666768692 unmodified lines7273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211329 unmodified lines1431441451461471481497 unmodified lines1571581591601611623 unmodified lines16616716816917017117214 unmodified lines18718818919019119219320 unmodified linesself.addCleanup(self.temp.cleanup)self.root = Path(self.temp.name) / "generation"self.generation = fixture(self.root)def run_cli(self, *arguments):return subprocess.run([sys.executable, "-B", str(bench.ROOT / "scripts/benchmarks/benchmark_search_compute.py"),1 unmodified linecapture_output=True, timeout=90, check=False)def cli_args(self):return ("--data-dir", self.root, "--generation", self.generation, "--iterations", "2")def test_actual_cli_uses_selected_generation_from_another_working_directory(self):result = self.run_cli(*self.cli_args())4 unmodified linesself.assertEqual((report["records"], report["iterations"], report["warmups_per_query"]), (1, 2, 1))manifest = json.loads((self.root / "generation-manifest.json").read_bytes())self.assertEqual(report["space_files"], manifest["files"]["space"])self.assertEqual(report["manifest_sha256"], hashlib.sha256(encode(manifest)).hexdigest())self.assertEqual(report["source_sha256"]["backend/app.py"], bench.sha256_file(bench.ROOT / "backend/app.py"))self.assertTrue(report["tokenizer"]["initialized"])11 unmodified linesprogram = '''import runpy, socket, sysfrom unittest.mock import patchsys.argv = [script, "--data-dir", directory, "--generation", generation, "--iterations", "1"]with patch.object(socket.socket, "connect", side_effect=RuntimeError("network forbidden")), \\patch.object(socket.socket, "connect_ex", side_effect=RuntimeError("network forbidden")), \\patch.object(socket, "getaddrinfo", side_effect=RuntimeError("network forbidden")):runpy.run_path(script, run_name="__main__")'''prefix = (f"script={str(bench.ROOT / 'scripts/benchmarks/benchmark_search_compute.py')!r}\n"f"directory={str(self.root)!r}\ngeneration={self.generation!r}\n")result = subprocess.run([sys.executable, "-B", "-c", prefix + program], cwd=self.root.parent,capture_output=True, text=True, timeout=90, check=False)self.assertEqual(result.returncode, 0, result.stderr)2 unmodified linesdef test_temporary_cache_ignores_environment_inside_generation(self):program = '''import runpy, sys, tempfilesys.argv = [script, "--data-dir", directory, "--generation", generation]def forbidden_probe():raise AssertionError("unexpected tempdir probe")tempfile.gettempdir = forbidden_proberunpy.run_path(script, run_name="__main__")'''prefix = (f"script={str(bench.ROOT / 'scripts/benchmarks/benchmark_search_compute.py')!r}\n"f"directory={str(self.root)!r}\ngeneration={self.generation!r}\n")result = subprocess.run([sys.executable, "-B", "-c", prefix + program], cwd=self.root.parent,env={**os.environ, "TMPDIR": str(self.root)},capture_output=True, text=True, timeout=30, check=False)self.assertEqual(result.returncode, 0, result.stderr)self.assertEqual(json.loads(result.stdout)["generation"], self.generation)self.assertFalse(list(self.root.glob("space-bench-jieba-*")))self.assertFalse(list(self.root.parent.glob("space-bench-jieba-*")))def test_required_options_and_iteration_boundaries(self):for value in ("1", "100"):options = bench.parse_args(["--data-dir", str(self.root), "--generation", self.generation,"--iterations", value])self.assertEqual(options.iterations, int(value))for args in ([], ["--data-dir", str(self.root)],["--generation", self.generation],["--data-dir", str(self.root), "--generation", self.generation, "--iterations", "0"],["--data-dir", str(self.root), "--generation", self.generation, "--iterations", "101"],["--data-dir", str(self.root), "--generation", self.generation, "--iterations", "oops"]):with self.subTest(args=args), patch("sys.stderr"), self.assertRaises(SystemExit) as stopped:bench.parse_args(args)self.assertEqual(stopped.exception.code, 2)result = self.run_cli("--data-dir", self.root, "--generation", self.generation, "--iterations", "0")self.assertNotEqual(result.returncode, 0)self.assertIn("between 1 and 100", result.stderr)self.assertEqual(result.stdout, "")def test_missing_corrupt_or_wrong_generation_fails_before_importing_app(self):result = self.run_cli("--data-dir", self.root, "--generation", "f" * 64)self.assertNotEqual(result.returncode, 0)self.assertEqual(result.stdout, "")self.assertIn("invalid search generation manifest", result.stderr)29 unmodified linesexcluded = {"generation", "remote_writes", "publication_ready", "object_layout", "objects", "additional_checks"}manifest["generation"] = hashlib.sha256(encode({k: v for k, v in manifest.items() if k not in excluded})).hexdigest()manifest_path.write_bytes(encode(manifest))result = self.run_cli("--data-dir", self.root, "--generation", manifest["generation"])self.assertNotEqual(result.returncode, 0)self.assertIn("record count mismatch", result.stderr)manifest_path.unlink()7 unmodified linesself.assertNotEqual(result.returncode, 0)self.assertIn("missing or oversized", result.stderr)def test_noncanonical_manifest_types_and_duplicate_keys_are_rejected(self):manifest_path = self.root / "generation-manifest.json"original = manifest_path.read_bytes()3 unmodified linesexcluded = {"generation", "remote_writes", "publication_ready", "object_layout", "objects", "additional_checks"}modified["generation"] = hashlib.sha256(encode({k: v for k, v in modified.items() if k not in excluded})).hexdigest()manifest_path.write_bytes(encode(modified))result = self.run_cli("--data-dir", self.root, "--generation", modified["generation"])self.assertNotEqual(result.returncode, 0)self.assertIn("invalid generation manifest version or record count", result.stderr)manifest_path.write_bytes(b'{"version":1,' + original[1:])14 unmodified lines"search_ngrams_3.bin.gz"):original = (self.root / name).read_bytes()fault.rewrite(name, b"broken")result = self.run_cli("--data-dir", self.root, "--generation", fault.generation)self.assertNotEqual(result.returncode, 0, name)self.assertEqual(result.stdout, "")fault.rewrite(name, original)20 unmodified lines212223242526272829303132333435363738391 unmodified line41424344454647484 unmodified lines535455565758596011 unmodified lines72737475767778798081828384852 unmodified lines88899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517629 unmodified lines2062072082092102112122137 unmodified lines2212222232242252262272282292302312322332342352362372382392402412422432442452462472482493 unmodified lines25325425525625725825926014 unmodified lines27527627727827928028128220 unmodified linesself.addCleanup(self.temp.cleanup)self.root = Path(self.temp.name) / "generation"self.generation = fixture(self.root)# This benchmark verifies cross-surface corpus declarations as well as# the selector's complete materialized Space fixture.manifest = json.loads((self.root / "generation-manifest.json").read_bytes())manifest["files"]["pages"]["search_data.json.gz"] = dict(manifest["files"]["space"]["search_data.json.gz"])self.generation = self.write_manifest(manifest)self.cache_root = Path(self.temp.name) / "local-temp"self.cache_root.mkdir()def write_manifest(self, manifest):excluded = {"generation", "remote_writes", "publication_ready", "object_layout", "objects", "additional_checks"}manifest["generation"] = hashlib.sha256(encode({k: v for k, v in manifest.items() if k not in excluded})).hexdigest()(self.root / "generation-manifest.json").write_bytes(encode(manifest))return manifest["generation"]def run_cli(self, *arguments):return subprocess.run([sys.executable, "-B", str(bench.ROOT / "scripts/benchmarks/benchmark_search_compute.py"),1 unmodified linecapture_output=True, timeout=90, check=False)def cli_args(self):return ("--data-dir", self.root, "--generation", self.generation, "--temp-dir", self.cache_root,"--iterations", "2")def test_actual_cli_uses_selected_generation_from_another_working_directory(self):result = self.run_cli(*self.cli_args())4 unmodified linesself.assertEqual((report["records"], report["iterations"], report["warmups_per_query"]), (1, 2, 1))manifest = json.loads((self.root / "generation-manifest.json").read_bytes())self.assertEqual(report["space_files"], manifest["files"]["space"])self.assertTrue(report["pages_corpus_declaration_matches_space"])self.assertIn("Pages files and deployment not verified", report["input_assurance"])self.assertEqual(report["manifest_sha256"], hashlib.sha256(encode(manifest)).hexdigest())self.assertEqual(report["source_sha256"]["backend/app.py"], bench.sha256_file(bench.ROOT / "backend/app.py"))self.assertTrue(report["tokenizer"]["initialized"])11 unmodified linesprogram = '''import runpy, socket, sysfrom unittest.mock import patchsys.argv = [script, "--data-dir", directory, "--generation", generation, "--temp-dir", cache_root, "--iterations", "1"]with patch.object(socket.socket, "connect", side_effect=RuntimeError("network forbidden")), \\patch.object(socket.socket, "connect_ex", side_effect=RuntimeError("network forbidden")), \\patch.object(socket, "getaddrinfo", side_effect=RuntimeError("network forbidden")):runpy.run_path(script, run_name="__main__")'''prefix = (f"script={str(bench.ROOT / 'scripts/benchmarks/benchmark_search_compute.py')!r}\n"f"directory={str(self.root)!r}\ngeneration={self.generation!r}\ncache_root={str(self.cache_root)!r}\n")result = subprocess.run([sys.executable, "-B", "-c", prefix + program], cwd=self.root.parent,capture_output=True, text=True, timeout=90, check=False)self.assertEqual(result.returncode, 0, result.stderr)2 unmodified linesdef test_temporary_cache_ignores_environment_inside_generation(self):program = '''import runpy, sys, tempfilesys.argv = [script, "--data-dir", directory, "--generation", generation, "--temp-dir", cache_root]def forbidden_probe():raise AssertionError("unexpected tempdir probe")tempfile.gettempdir = forbidden_proberunpy.run_path(script, run_name="__main__")'''prefix = (f"script={str(bench.ROOT / 'scripts/benchmarks/benchmark_search_compute.py')!r}\n"f"directory={str(self.root)!r}\ngeneration={self.generation!r}\ncache_root={str(self.cache_root)!r}\n")result = subprocess.run([sys.executable, "-B", "-c", prefix + program], cwd=self.root.parent,env={**os.environ, "TMPDIR": str(self.root)},capture_output=True, text=True, timeout=30, check=False)self.assertEqual(result.returncode, 0, result.stderr)self.assertEqual(json.loads(result.stdout)["generation"], self.generation)self.assertFalse(list(self.root.glob("space-bench-jieba-*")))self.assertFalse(list(self.cache_root.glob("space-bench-jieba-*")))def test_read_only_generation_parent_uses_explicit_external_temporary_root(self):# Read-only generation/mount with a separate caller-controlled cache root.mount = self.root.parent / "mount"mount.mkdir()mounted = mount / "generation"self.root.rename(mounted)self.root = mountedmount.chmod(0o555)self.root.chmod(0o555)self.addCleanup(mount.chmod, 0o755)self.addCleanup(self.root.chmod, 0o755)result = self.run_cli(*self.cli_args())self.assertEqual(result.returncode, 0, result.stderr)self.assertEqual(json.loads(result.stdout)["generation"], self.generation)self.assertEqual(sorted(path.name for path in mount.iterdir()), ["generation"])self.assertFalse(list(self.cache_root.iterdir()))def test_temporary_root_cannot_resolve_inside_generation(self):link = self.root.parent / "cache-link"link.symlink_to(self.root / "sidebar", target_is_directory=True)for path in (self.root, self.root / "sidebar", link):result = self.run_cli("--data-dir", self.root, "--generation", self.generation,"--temp-dir", path)with self.subTest(path=path):self.assertNotEqual(result.returncode, 0)self.assertIn("temporary cache directory must be outside", result.stderr)self.assertEqual(result.stdout, "")for path in (self.root.parent / "missing", self.root / "generation-manifest.json"):result = self.run_cli("--data-dir", self.root, "--generation", self.generation,"--temp-dir", path)with self.subTest(path=path):self.assertNotEqual(result.returncode, 0)self.assertEqual(result.stdout, "")def test_current_directory_cannot_be_the_generation(self):result = subprocess.run([sys.executable, "-B", str(bench.ROOT / "scripts/benchmarks/benchmark_search_compute.py"),*map(str, self.cli_args())], cwd=self.root, text=True,capture_output=True, timeout=30, check=False)self.assertNotEqual(result.returncode, 0)self.assertIn("current directory must be outside selected generation", result.stderr)self.assertFalse(list(self.root.rglob("space-bench-jieba-*")))def test_required_options_and_iteration_boundaries(self):for value in ("1", "100"):options = bench.parse_args(["--data-dir", str(self.root), "--generation", self.generation,"--temp-dir", str(self.cache_root), "--iterations", value])self.assertEqual(options.iterations, int(value))for args in ([], ["--data-dir", str(self.root)],["--generation", self.generation],["--data-dir", str(self.root), "--generation", self.generation],["--data-dir", str(self.root), "--generation", self.generation, "--temp-dir", str(self.cache_root),"--iterations", "0"],["--data-dir", str(self.root), "--generation", self.generation, "--temp-dir", str(self.cache_root),"--iterations", "101"],["--data-dir", str(self.root), "--generation", self.generation, "--temp-dir", str(self.cache_root),"--iterations", "oops"]):with self.subTest(args=args), patch("sys.stderr"), self.assertRaises(SystemExit) as stopped:bench.parse_args(args)self.assertEqual(stopped.exception.code, 2)result = self.run_cli("--data-dir", self.root, "--generation", self.generation,"--temp-dir", self.cache_root, "--iterations", "0")self.assertNotEqual(result.returncode, 0)self.assertIn("between 1 and 100", result.stderr)self.assertEqual(result.stdout, "")def test_missing_corrupt_or_wrong_generation_fails_before_importing_app(self):result = self.run_cli("--data-dir", self.root, "--generation", "f" * 64, "--temp-dir", self.cache_root)self.assertNotEqual(result.returncode, 0)self.assertEqual(result.stdout, "")self.assertIn("invalid search generation manifest", result.stderr)29 unmodified linesexcluded = {"generation", "remote_writes", "publication_ready", "object_layout", "objects", "additional_checks"}manifest["generation"] = hashlib.sha256(encode({k: v for k, v in manifest.items() if k not in excluded})).hexdigest()manifest_path.write_bytes(encode(manifest))result = self.run_cli("--data-dir", self.root, "--generation", manifest["generation"],"--temp-dir", self.cache_root)self.assertNotEqual(result.returncode, 0)self.assertIn("record count mismatch", result.stderr)manifest_path.unlink()7 unmodified linesself.assertNotEqual(result.returncode, 0)self.assertIn("missing or oversized", result.stderr)def test_pages_corpus_declaration_must_match_space_sha_and_length(self):manifest_path = self.root / "generation-manifest.json"original = json.loads(manifest_path.read_bytes())space = original["files"]["space"]["search_data.json.gz"]for declaration in (None, {}, {**space, "sha256": "f" * 64},{**space, "bytes": space["bytes"] + 1},{**space, "bytes": True}, {**space, "extra": "unexpected"}):manifest = json.loads(json.dumps(original))if declaration is None:del manifest["files"]["pages"]["search_data.json.gz"]else:manifest["files"]["pages"]["search_data.json.gz"] = declarationgeneration = self.write_manifest(manifest)# Space's normal selector alone accepts this recomputed, self-consistent# identity; the benchmark must additionally reject the cross-site mismatch.self.assertEqual(bench.inspect_generation(self.root, generation).record_count, 1)result = self.run_cli("--data-dir", self.root, "--generation", generation,"--temp-dir", self.cache_root)with self.subTest(declaration=declaration):self.assertNotEqual(result.returncode, 0)self.assertIn("Pages and Space declared corpus hash or size mismatch", result.stderr)self.assertEqual(result.stdout, "")def test_noncanonical_manifest_types_and_duplicate_keys_are_rejected(self):manifest_path = self.root / "generation-manifest.json"original = manifest_path.read_bytes()3 unmodified linesexcluded = {"generation", "remote_writes", "publication_ready", "object_layout", "objects", "additional_checks"}modified["generation"] = hashlib.sha256(encode({k: v for k, v in modified.items() if k not in excluded})).hexdigest()manifest_path.write_bytes(encode(modified))result = self.run_cli("--data-dir", self.root, "--generation", modified["generation"],"--temp-dir", self.cache_root)self.assertNotEqual(result.returncode, 0)self.assertIn("invalid generation manifest version or record count", result.stderr)manifest_path.write_bytes(b'{"version":1,' + original[1:])14 unmodified lines"search_ngrams_3.bin.gz"):original = (self.root / name).read_bytes()fault.rewrite(name, b"broken")result = self.run_cli("--data-dir", self.root, "--generation", fault.generation,"--temp-dir", self.cache_root)self.assertNotEqual(result.returncode, 0, name)self.assertEqual(result.stdout, "")fault.rewrite(name, original)
scripts/benchmarks/benchmark_search_compute.py+32-12
tests/gates/ci-test-inventory.json+1-1
tests/performance/test_search_compute_benchmark.py+104-15