Skip to content

Four compile_time_of_ifs_in_a_row tests fail on main: the Vx solver cannot prove their ensures #4567

Done

Description

@hiraditya

Four tests in tests/integration_test/compile_time_of_ifs_in_a_row.rs fail on main 9acbab8:

  • thirty_one_sided_ifs_in_a_row_type_check_in_seconds
  • thirty_if_else_statements_in_a_row_type_check_in_seconds
  • thirty_field_if_else_statements_in_a_row_type_check_in_seconds
  • twelve_four_arm_matches_in_a_row_type_check_in_seconds

cargo test --test integration_test compile_time_of_ifs_in_a_row (debug build):

vxc failed on 30 one-sided if statements in a row:
Warning at /tmp/.tmppEoXos/prog.vx:36:3: SMT solver error: the solver written in Vx found neither a proof nor a counterexample. It may have reached its limit of 10000 steps
Error[E8001] at /tmp/.tmppEoXos/prog.vx:36:3: Function 'step' cannot prove postcondition (ensures) at compile time

#4473 added these tests at 3242769, and its checks used z3. #4557 (0b8dc58) then made the solver written in Vx the default. So the tests now use that solver, and it cannot prove the ensures of step. PR #4565 reports the same failures. It also says that the Vx solver takes about 10 s on these programs in a debug build, and z3 takes 0.4 s.

Part of #4268.

Activity

  1. hiraditya commented on Dec 4, 2026

    @hiraditya
    CollaboratorAuthor

    More data, from #4574, which repeats this issue:

    Warning at prog.vx:36:3: SMT solver error: the solver written in Vx found neither a proof nor a counterexample. It may have reached its limit of 10000 steps
    Error[E8001] at prog.vx:36:3: Function 'step' cannot prove postcondition (ensures) at compile time
    

    vxc prog.vx -j 1 --action print-ast, with a debug vxc on main 9acbab8 and libvx_solver.so from scripts/build_solver_library.sh:

    Test program Solver written in Vx z3 (VX_SOLVER=z3)
    30 if/else statements E8001 at the step limit, 9.8 s proved, 0.4 s
    30 one-sided if statements E8001 at the step limit, 2.6 s proved, 0.3 s
    30 if/else statements on a struct field E8001 at the step limit, 14.1 s proved, 0.6 s
    12 four-arm match statements no result after 120 s (stopped) proved, 0.7 s

    The test file builds each program. Its time limit is 5 s.

    Generated With Claude Code

  2. hiraditya commented on Dec 4, 2026

    @hiraditya
    CollaboratorAuthor

    #4584 makes the solver written in Vx prove the 4 programs of this issue within 10000 steps. For each mod and div by a constant, q is 0 when the sum is in range, and the simplex checks the atoms during the search for each query. It also fixes #4488.

    The tests of compile_time_of_ifs_in_a_row.rs still choose z3 after #4584. With the runtime of a debug build, each program takes about 2 s alone, and 2 of them went past the 5 s limit under the load of the test suite. #4583 has the cause: the runtime work around each drop at opt-level 0. A PR stacked on #4584 builds that runtime with optimization in debug builds, and removes VX_SOLVER=z3 from these tests. That PR fixes this issue.

  3. hiraditya commented on Dec 4, 2026

    @hiraditya
    CollaboratorAuthor

    #4585, stacked on #4584, fixes this issue: it builds the runtime at opt-level 3 in debug builds, and removes VX_SOLVER=z3 from compile_time_of_ifs_in_a_row.rs. In its commit hook, the five tests passed with the solver written in Vx, under the load of the whole suite.

  4. added a commit that references this issue on Dec 4, 2026
    04a5582
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions