Skip to content

BaB restructuring, CLIMB certificate reuse and CI invariants (part 3/3 of #115) - #119

Merged
yuleisui merged 4 commits into
SVF-tools:mainfrom
guanqin-123:TensorCE
Oct 23, 2026
Merged

yuleisui merged 4 commits into
SVF-tools:mainfrom
guanqin-123:TensorCE

Conversation

@guanqin-123

Copy link
Copy Markdown
Contributor

Part 3 of 3 of #115 (parts 1 and 2 merged as #116 and #118); a single commit on main.

  • CLIMB certificate reuse (opt-in): replays certified dual certificates as ReLU phase cores and propagates them to prune BaB subproblems early.
  • BaB restructuring: split, violation-check and multi-split logic move out of bab.py into node.py, violation.py, 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.

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.
@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.25086% with 378 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.63%. Comparing base (64ce70a) to head (f926336).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
act/back_end/bab/branching/multi_split.py 51.95% 86 Missing ⚠️
act/back_end/bab/violation.py 59.62% 86 Missing ⚠️
act/back_end/bab/node.py 63.15% 56 Missing ⚠️
act/back_end/bab/climb.py 90.55% 53 Missing ⚠️
act/back_end/bab/bab.py 80.00% 30 Missing ⚠️
act/back_end/bab/branching/branching.py 80.34% 23 Missing ⚠️
act/back_end/bab/branching/bounding.py 71.73% 13 Missing ⚠️
act/back_end/solver/solver_dual.py 92.25% 11 Missing ⚠️
act/front_end/vnnlib_loader/data_model_loader.py 42.85% 8 Missing ⚠️
act/util/download_utils.py 88.57% 4 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #119      +/-   ##
==========================================
+ Coverage   76.85%   77.63%   +0.78%     
==========================================
  Files          91       95       +4     
  Lines       22367    23009     +642     
==========================================
+ Hits        17191    17864     +673     
+ Misses       5176     5145      -31     
Flag Coverage Δ
bab 47.12% <75.25%> (-2.39%) ⬇️
backend-float32 50.26% <29.74%> (-0.45%) ⬇️
backend-float64 51.99% <29.74%> (-0.50%) ⬇️
frontend 30.90% <9.66%> (-0.49%) ⬇️
pipeline-fuzz 20.31% <6.84%> (-0.34%) ⬇️
pipeline-verify 43.24% <28.94%> (-0.37%) ⬇️

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

Files with missing lines Coverage Δ
act/back_end/__init__.py 100.00% <ø> (ø)
act/back_end/bab/__init__.py 100.00% <100.00%> (ø)
act/back_end/core.py 97.16% <ø> (+8.00%) ⬆️
act/back_end/dual_tf/tf_forward.py 80.23% <ø> (-0.07%) ⬇️
act/back_end/serialization/serialization.py 87.80% <100.00%> (-0.30%) ⬇️
act/back_end/verifier.py 83.86% <100.00%> (-0.06%) ⬇️
act/pipeline/fuzzing/actfuzzer.py 92.16% <100.00%> (ø)
act/pipeline/verification/model_factory.py 83.01% <100.00%> (ø)
act/pipeline/verification/torch2act.py 61.29% <ø> (-0.68%) ⬇️
act/pipeline/verification/utils.py 42.34% <ø> (-0.09%) ⬇️
... and 16 more

... and 8 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 64ce70a...f926336. 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 add asserts where necessary and replace return/print with asserts.

- backend_cli: errors in --verify/--generate/--diff-nets/--self-test and
  the serialization test propagate (traceback, exit 1) instead of being
  printed and mapped to a return code; "no verdict" is an assertion. The
  explicit unsupported-layer skip (exit 1) and ConfigError (exit 2) keep
  their exit codes. config.py's self-test raises on the first failure.
- solver_dual: a net without an INPUT layer, missing INPUT bounds, a
  non-tensor DENSE weight and a RELU layer without bounds are assertion
  failures instead of silently disabling the refresh/alpha.
- climb.certificate_replay asserts the solver returned nu_per_layer.
- node.split_neurons asserts the child count and parent_index length.
@guanqin-123

Copy link
Copy Markdown
Contributor Author

Could you add asserts where necessary and replace return/print with asserts.

revised

@yuleisui

Copy link
Copy Markdown
Collaborator

Could you add a new Jupyter notebook file to demonstrate tensor bab?

@yuleisui

Copy link
Copy Markdown
Collaborator

When adding a demo .ipynb, try to simplify these 3 patches too and delete/remove unused code where necessary.

- ipynb/tensor_bab.ipynb and its README section: K-batched
  branch-and-bound on three VNN-COMP instances, each decided only after
  branching: ACAS Xu prop_3 CERTIFIED and prop_2 FALSIFIED (input
  splitting), and a CIFAR-100 ResNet CERTIFIED (neuron splitting), with
  the per-iteration trace, plots and the counterexample check.
- verify_bab_batched: public `trace` parameter replaces the private
  `_k_log`; result metadata gains `iterations`.
- Delete the zero-reference Layer.get_bounds_for_var,
  ConSet._is_op_supported_by_exporter, VerifyResult.is_conclusive,
  VerifyResult.is_safe and SpecBatchResult.worst_violation, and the unused
  imports and locals flagged by ruff F401/F841/F811 in 17 files.
The SVHN host (ufldl.stanford.edu) is down, so
`python -m act.front_end --download SVHN` crashed with URLError and
failed the Frontend Tests job.

- act/util/download_utils.py: a new "unavailable" download status.
  is_source_unreachable() treats DNS failures, refused or reset
  connections, timeouts, unreachable hosts and HTTP 502/503/504 as an
  outage; any other HTTP status (e.g. 404) stays an error.
  report_unavailable() prints a SKIPPED notice and, under GitHub
  Actions, a warning annotation.
- The TorchVision and VNNLIB loaders return "unavailable" when every
  attempt failed that way, after removing the directories the attempt
  created (an empty raw/ made later calls treat the dataset as
  downloaded).
- The unified --download (act.front_end and act.pipeline) and both
  loader CLIs report it as a skip and exit 0; every other failure
  still fails.
@guanqin-123

Copy link
Copy Markdown
Contributor Author

When adding a demo .ipynb, try to simplify these 3 patches too and delete/remove unused code where necessary.

added.

@yuleisui
yuleisui merged commit c55892e into SVF-tools:main Oct 23, 2026
9 checks passed
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