Skip to content

Fix WP timeout in okj_measure_container#67

Merged
ionux merged 2 commits into
mainfrom
claude/fix-wp-timeout-anFtc
Mar 25, 2026
Merged

Fix WP timeout in okj_measure_container#67
ionux merged 2 commits into
mainfrom
claude/fix-wp-timeout-anFtc

Conversation

@ionux

@ionux ionux commented Mar 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • The Alt-Ergo prover timed out on typed_okj_measure_container_assert — the loop-progress assertion p > p_entry at the end of the outer loop body
  • Root cause: the '"' branch contains a nested inner loop (string skipping), making the combined proof obligation too complex for a single solver step
  • Fix: add an intermediate //@ assert p > p_entry; after the string-skip branch so the prover can discharge each branch independently

Test plan

  • CI passes with 830/830 goals proved and 0 timeouts

https://claude.ai/code/session_01LFxTXPy7Ut9JhJVnkTbYqM

The prover timed out on the loop-progress assert because the '"' branch
contains a nested inner loop, making the proof obligation too complex for
a single step. Adding an intermediate assert after the string-skip branch
splits the proof so Alt-Ergo can discharge each branch independently.

https://claude.ai/code/session_01LFxTXPy7Ut9JhJVnkTbYqM
@ionux

ionux commented Mar 25, 2026

Copy link
Copy Markdown
Owner Author

Still have a timeout:

[kernel] Parsing src/ok_json.c (with preprocessing)
[wp] Running WP plugin...
[rte:annot] annotating function okj_init
[rte:annot] annotating function okj_get_string
[rte:annot] annotating function okj_get_number
[rte:annot] annotating function okj_get_boolean
[rte:annot] annotating function okj_get_array
[rte:annot] annotating function okj_get_object
[rte:annot] annotating function okj_get_token
[rte:annot] annotating function okj_get_array_raw
[rte:annot] annotating function okj_get_object_raw
[rte:annot] annotating function okj_copy_string
[rte:annot] annotating function okj_count_objects
[rte:annot] annotating function okj_count_arrays
[rte:annot] annotating function okj_count_elements
[rte:annot] annotating function okj_is_whitespace
[rte:annot] annotating function okj_is_digit
[rte:annot] annotating function okj_is_hex_digit
[rte:annot] annotating function okj_is_utf8_continuation
[rte:annot] annotating function okj_validate_utf8_sequence
[rte:annot] annotating function okj_match
[rte:annot] annotating function okj_is_value_terminator
[rte:annot] annotating function okj_skip_string
[rte:annot] annotating function okj_count_array_elements
[rte:annot] annotating function okj_count_object_members
[rte:annot] annotating function okj_measure_container
[rte:annot] annotating function okj_skip_whitespace
[rte:annot] annotating function okj_find_value_index
[wp] Computing [100 goals...]
[wp] Computing [200 goals...]
[wp] Computing [300 goals...]
[wp] Computing [400 goals...]
[wp] Computing [500 goals...]
[wp] Computing [600 goals...]
[wp] Computing [700 goals...]
[wp] Computing [800 goals...]
[wp] 807 goals scheduled
[wp] [Timeout] typed_okj_measure_container_assert (Qed 92ms) (Alt-Ergo)
[wp] Proved goals: 830 / 831
Terminating: 12
Unreachable: 12
Qed: 566 (1ms-58ms-29.6s)
Alt-Ergo 2.5.4: 240 (10ms-31ms-124ms)
Timeout: 1

…ainer assert

Add `p >= p_entry + 1` invariant to the inner string-skipping loop and
an assertion before the loop establishing the initial value. This gives
Alt-Ergo a direct proof path for the `p > p_entry` assertion after the
string-skip branch, avoiding the timeout on typed_okj_measure_container_assert.

https://claude.ai/code/session_01LFxTXPy7Ut9JhJVnkTbYqM
@ionux ionux merged commit b6eb443 into main Mar 25, 2026
3 checks passed
@ionux ionux deleted the claude/fix-wp-timeout-anFtc branch March 25, 2026 01:40
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