Skip to content

Fail loudly on errors; fix Torch->ACT conversion; remove legacy code (part 1/3 of #115) - #116

Merged
yuleisui merged 1 commit into
SVF-tools:mainfrom
guanqin-123:part1
Oct 13, 2026
Merged

yuleisui merged 1 commit into
SVF-tools:mainfrom
guanqin-123:part1

Conversation

@guanqin-123

Copy link
Copy Markdown
Contributor

Part 1 of 3 of #115 (no BaB/CLIMB changes).

  • Raise on errors instead of printing/returning empty (back_end core, loaders, CLIs, test harnesses); CI steps that exited 0 on failure now fail.
  • Torch→ACT: convert ReLU6/adaptive_avg_pool2d; fix BatchNorm SCALE being bypassed; assert layer dataflow.
  • Remove legacy/unused code and duplicated CLI commands (−1,300 lines).

Part 1 of 3 of the TensorCE work (SVF-tools#115): the changes that are independent
of the BaB/CLIMB restructuring.

Errors are raised where they occur instead of printed or swallowed:
- back_end core/serialization/layer_util/solver_hz/hybridz_tf and util
  raise instead of printing or returning empty results; fix a NaN in the
  HybridZ softmax ratio bound.
- vnnlib: reject multi-input properties before parsing (pipeline exit 3);
  fuzzing exits 1 on failure and writes counterexample witnesses from the
  stored tensors.
- torch2act/act2torch harnesses raise on failed conversions or test cases
  and when nothing ran; spec creation raises per-instance failures; the
  front_end, pipeline and loader CLIs assert download/inference success and
  re-raise after printing their hints instead of exiting 0.

Torch->ACT conversion:
- Convert nn.ReLU6 and F.adaptive_avg_pool2d (torchvision mobilenet_v2;
  CI's torch2act step hid 4/36 failed conversions behind PASSED).
- Enter chain conversions (BatchNorm -> SCALE + BIAS, c - x,
  DequantizeLinear) at their head: the incoming edge bypassed SCALE, so
  abstract interpretation ran on a different network than the PyTorch
  model (SVHN resnet18: output 0.95 outside the bounds -> 7e-15 after).
  TorchToACT.run asserts that every layer reads only variables produced by
  its predecessors.

Legacy and duplicated code removed: ACTStats/ACTLog; the unused profiler,
parallel-executor and retry/timeout harness in pipeline/verification/utils
and its act.pipeline re-exports; Config.to_yaml (x2); unused Net/Layer
accessors; convert_and_save_pytorch; net_factory.append_concat;
get_solver_mode. pipeline_cli's data-model commands now dispatch to
frontend_cli's unified handlers instead of duplicating them.
@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.95030% with 126 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.90%. Comparing base (e9ed992) to head (662d994).

Files with missing lines Patch % Lines
.../front_end/torchvision_loader/data_model_loader.py 66.66% 43 Missing ⚠️
act/front_end/vnnlib_loader/data_model_loader.py 76.47% 20 Missing ⚠️
act/front_end/vnnlib_loader/onnx_converter.py 5.00% 19 Missing ⚠️
act/util/device_manager.py 73.33% 8 Missing ⚠️
act/back_end/solver/solver_hz.py 60.00% 6 Missing ⚠️
act/pipeline/verification/torch2act.py 85.00% 6 Missing ⚠️
act/front_end/vnnlib_loader/vnnlib_parser.py 91.52% 5 Missing ⚠️
act/back_end/core.py 0.00% 4 Missing ⚠️
act/pipeline/verification/model_factory.py 80.95% 4 Missing ⚠️
act/pipeline/verification/utils.py 75.00% 3 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #116      +/-   ##
==========================================
+ Coverage   75.44%   76.90%   +1.46%     
==========================================
  Files          91       91              
  Lines       22575    22143     -432     
==========================================
- Hits        17032    17030       -2     
+ Misses       5543     5113     -430     
Flag Coverage Δ
bab 48.95% <38.36%> (+5.39%) ⬆️
backend-float32 50.45% <16.50%> (+0.96%) ⬆️
backend-float64 52.12% <18.09%> (+0.86%) ⬆️
frontend 31.61% <63.41%> (+0.07%) ⬆️
pipeline-fuzz 20.76% <32.00%> (+0.39%) ⬆️
pipeline-verify 43.63% <52.68%> (+1.98%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
act/back_end/hybridz_tf/hybridz_tf.py 95.76% <100.00%> (+0.28%) ⬆️
act/back_end/hybridz_tf/tf_transformer.py 78.60% <100.00%> (+0.32%) ⬆️
act/back_end/layer_util.py 69.74% <100.00%> (+0.89%) ⬆️
act/back_end/net_factory.py 88.13% <100.00%> (+0.31%) ⬆️
act/back_end/serialization/serialization.py 88.09% <100.00%> (+12.09%) ⬆️
act/back_end/transfer_functions.py 90.62% <100.00%> (+0.62%) ⬆️
act/pipeline/__init__.py 100.00% <ø> (+57.14%) ⬆️
act/pipeline/fuzzing/actfuzzer.py 92.16% <100.00%> (+1.13%) ⬆️
act/pipeline/verification/validate_verifier.py 83.50% <100.00%> (+0.60%) ⬆️
act/util/format_utils.py 95.65% <100.00%> (+8.69%) ⬆️
... and 17 more

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e9ed992...662d994. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yuleisui

Copy link
Copy Markdown
Collaborator

Could you confirm that you would like this to be reviewed anddiscard #115? If so, please close #115.

@yuleisui
yuleisui merged commit 4aeceaa into SVF-tools:main Oct 13, 2026
9 checks passed
guanqin-123 added a commit to guanqin-123/ACT that referenced this pull request Oct 14, 2026
Part 3 of 3 of SVF-tools#115 (parts 1 and 2 merged as SVF-tools#116 and SVF-tools#118).

- CLIMB certificate reuse (opt-in): certified dual certificates are
  replayed as ReLU phase cores and propagated to prune BaB subproblems
  early (bab/climb.py).
- BaB restructuring: split, violation-check and multi-split logic move
  out of bab.py into node.py, violation.py and branching/multi_split.py
  (bab.py 2191 -> 1151 lines, branching.py 1217 -> 1094).
- BaB config: reuse_root_bounds becomes the root_bounds_reuse tri-state;
  CLIMB preset; every backend.yaml option documented; input splits can
  no longer pick a zero-width dimension.
- CI: act-bab.yml grep checks replaced by in-source invariants and
  exit-status checks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants