STRA-338 S17: inline modules of the cuda-driver root and FFI files move to files, lib.rs and ffi/enabled.rs split by responsibility
lib.rs 3508 -> 938 lines, ffi.rs 1897 -> small, qwen_dispatch.rs 2003 and qwen_ffi.rs 1696 lose their inline test and installed-proof modules (scripts/dev/extract_modules.py, 5 self-tests; split_module.py --allow-root for lib.rs). Module paths, visibility and test ids are unchanged: 544 test ids before and after, cuda-driver tests 433 passed / 78 ignored before and after (Linux), host check clean. GPU identity and A/B follow with the combined batch 1+2 gate.
This commit is contained in:
@@ -36,7 +36,7 @@ def is_root(path):
|
||||
|
||||
|
||||
def child_dir(path):
|
||||
return path.parent if path.name == "mod.rs" else path.with_suffix("")
|
||||
return path.parent if path.name in ("mod.rs", "lib.rs", "main.rs") else path.with_suffix("")
|
||||
|
||||
|
||||
def path_targets():
|
||||
@@ -50,8 +50,8 @@ def path_targets():
|
||||
return found
|
||||
|
||||
|
||||
def process(path, target, dry_run, loaded):
|
||||
if is_root(path):
|
||||
def process(path, target, dry_run, loaded, allow_root=False):
|
||||
if is_root(path) and not (allow_root and path.name == "lib.rs"):
|
||||
return "skipped", "crate root, bin or example"
|
||||
directory = child_dir(path)
|
||||
explicit = directory.name if path.name in loaded else None
|
||||
@@ -71,11 +71,12 @@ def main(argv):
|
||||
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
parser.add_argument("--dry-run", action="store_true")
|
||||
parser.add_argument("--target", type=int, default=250)
|
||||
parser.add_argument("--allow-root", action="store_true", help="also split a lib.rs crate root")
|
||||
parser.add_argument("files", nargs="+")
|
||||
args = parser.parse_args(argv)
|
||||
loaded = path_targets()
|
||||
for name in args.files:
|
||||
verdict, detail = process(pathlib.Path(name), args.target, args.dry_run, loaded)
|
||||
verdict, detail = process(pathlib.Path(name), args.target, args.dry_run, loaded, args.allow_root)
|
||||
print(f"{verdict} {name} {detail}")
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user