hegeltest 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb8c993c96147e6daa25ae1f1e2f03e1793a15cfa6d3229aec8f6e4933046810
4
- data.tar.gz: 7932ca5e60d9239c998b8399b6ca6e96391dd776f081f89fb6d951dfa630c6a1
3
+ metadata.gz: 050dad9d0ff9759857669ca00e9cd06a1cfdb477057c4ae57aee108541bca4bd
4
+ data.tar.gz: de5e05dcd08f7fe3f88f52d59cbf3baa2a1a27a35461e6933b41ab60efbd8826
5
5
  SHA512:
6
- metadata.gz: bc9c0ff381eb116f0f1382fe9c59335b5b8fdfca93417a78b5e055c9883a23458dead237e0b671c392bb3aa71978ec03f799b2d56e0b8515d09e780e34345a15
7
- data.tar.gz: 4bcac43291698082a9185d302f2a487e81768d8bc0b443f88dc2f7a4609f809354961404aa61ab8fe89d787a495d7828e3b8d441fc76303028a3ced68950e88d
6
+ metadata.gz: 10222418a9cb8ada863b70be2fe7be8ecf9671f7853880139b814836d88b4bdf1aa4e398e2d08522dfd7838814aaa236545ce84198e83ee235851689691114aa
7
+ data.tar.gz: 70d71fc4106eaf3038685eac2c2703f0f60330213cbe00759806c01a2c58d64f1079274da259812daa4718a9e27f026b9d61397b53b926cfa5ce2948d4ace80f
data/CHANGELOG.md CHANGED
@@ -2,6 +2,59 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.5.2] - 2026-11-14
6
+
7
+ ### Engine: libhegel 0.51.5 (was 0.51.1)
8
+
9
+ The [libhegel 0.51.5 release notes](https://github.com/hegeldev/hegel/releases/tag/libhegel/0.51.5)
10
+ describe 0.51.5. The move also includes 0.51.2, 0.51.3, and 0.51.4, and the
11
+ [libhegel changelog at 0.51.5](https://github.com/hegeldev/hegel/blob/libhegel/0.51.5/libhegel/CHANGELOG.md)
12
+ describes all four releases.
13
+
14
+ Each platform gem carries `libhegel` 0.51.5. A caller has nothing to
15
+ change. The public methods keep their signatures and return values.
16
+
17
+ In 0.51.4, the engine shrinks two kinds of recursive values better. A
18
+ recursive value whose branches can hold one child can now shrink to a
19
+ branch of one child. A value that the engine found after it abandoned
20
+ earlier attempts to draw it now shrinks fully. A failure report can so
21
+ show a smaller counterexample than before.
22
+
23
+ In 0.51.5, the engine adds two functions, `hegel_pause_faults` and
24
+ `hegel_unpause_faults`. These bindings do not call them, and this release
25
+ does not add a way to pause faults. 0.51.2 and 0.51.3 change only the
26
+ internals of the engine.
27
+
28
+ ## [0.5.1] - 2026-11-11
29
+
30
+ ### Engine: libhegel 0.51.1 (was 0.50.0)
31
+
32
+ The [libhegel 0.51.1 release notes](https://github.com/hegeldev/hegel/releases/tag/libhegel/0.51.1)
33
+ describe 0.51.1. The move also includes 0.51.0, and the
34
+ [libhegel changelog at 0.51.1](https://github.com/hegeldev/hegel/blob/libhegel/0.51.1/libhegel/CHANGELOG.md)
35
+ describes both releases.
36
+
37
+ Each platform gem carries `libhegel` 0.51.1. A caller has nothing to
38
+ change. The public methods keep their signatures and return values.
39
+
40
+ In 0.51.0, the engine lets a state machine redraw its configuration
41
+ between rounds, and to do this it changes one function that these
42
+ bindings call: `hegel_state_machine_next_group` takes a new out-parameter
43
+ for the concurrency level of the round. These bindings pass it.
44
+ `Hegel::Stateful.run` and `Hegel::StateMachine` keep a sequential
45
+ machine, so the level is always 1. At the start of each round, the engine
46
+ now redraws, with probability 1/50, which rules the machine enables and
47
+ how it distributes drawn values, as the engine release notes say. A long
48
+ run can so explore more than one configuration.
49
+
50
+ In 0.51.1, a run of one test case (`test_cases: 1`) inside Antithesis
51
+ (`ANTITHESIS_OUTPUT_DIR` is set) with no `database_key` does not record
52
+ the choices of its test case. Its failure is reported from its one
53
+ execution: `Hegel.test` raises the exception of the body, but the engine
54
+ does not shrink or replay the failure, the report shows no drawn values,
55
+ and it has no reproduce blob. A run outside Antithesis, or with a
56
+ `database_key`, does not change.
57
+
5
58
  ## [0.5.0] - 2026-11-04
6
59
 
7
60
  ### Engine: libhegel 0.50.0 (was 0.49.0)
@@ -515,6 +568,8 @@ The engine is called through the `ffi` gem. Each platform gem carries the
515
568
  matching `libhegel` 0.32.5 build. The platform-independent gem carries none,
516
569
  so a run on it needs `HEGEL_LIBHEGEL_PATH` pointing at a local build.
517
570
 
571
+ [0.5.2]: https://github.com/meganemura/hegel-ruby/releases/tag/v0.5.2
572
+ [0.5.1]: https://github.com/meganemura/hegel-ruby/releases/tag/v0.5.1
518
573
  [0.5.0]: https://github.com/meganemura/hegel-ruby/releases/tag/v0.5.0
519
574
  [0.4.1]: https://github.com/meganemura/hegel-ruby/releases/tag/v0.4.1
520
575
  [0.4.0]: https://github.com/meganemura/hegel-ruby/releases/tag/v0.4.0
@@ -228,7 +228,7 @@ module Hegel
228
228
  "hegel_state_machine_start", [:pointer, :pointer, :pointer, :pointer], :int32
229
229
  )
230
230
  @hegel_state_machine_next_group_fn = bind(
231
- "hegel_state_machine_next_group", [:pointer, :pointer, :pointer, :pointer], :int32
231
+ "hegel_state_machine_next_group", [:pointer, :pointer, :pointer, :pointer, :pointer], :int32
232
232
  )
233
233
  @hegel_state_machine_next_rule_fn = bind(
234
234
  "hegel_state_machine_next_rule", [:pointer, :pointer, :pointer, :int64, :pointer], :int32
@@ -958,10 +958,11 @@ module Hegel
958
958
  # invariant in one call.
959
959
  #
960
960
  # The machine is always sequential: a concurrency of exactly 1, so
961
- # the engine draws no concurrency level. These bindings drive the
962
- # engine from one thread, and a concurrent machine needs one worker
963
- # thread per drawn level. For the same reason the rule calls below
964
- # pass worker index 0, the only worker there is.
961
+ # every concurrency level the engine draws is 1. These bindings drive
962
+ # the engine from one thread, and a concurrent machine needs one
963
+ # worker thread for each of max_concurrency workers. For the same
964
+ # reason the rule calls below pass worker index 0, the only worker
965
+ # there is, and that worker is active in every round.
965
966
  def new_state_machine(ctx, tc, step_count)
966
967
  out = FFI::MemoryPointer.new(:pointer)
967
968
  code = @hegel_new_state_machine_fn.call(ctx, tc, 1, 1, step_count, out)
@@ -994,9 +995,10 @@ module Hegel
994
995
  nil
995
996
  end
996
997
 
997
- # Seals the declared rules and invariants, and returns the
998
- # concurrency level the engine drew. For the machine
999
- # #new_state_machine opens, that level is always 1.
998
+ # Seals the declared rules and invariants, and returns the number of
999
+ # workers the caller must run: max_concurrency, since libhegel
1000
+ # 0.51.0. Before 0.51.0, it was the concurrency level the engine drew.
1001
+ # For the machine #new_state_machine opens, both are always 1.
1000
1002
  def state_machine_start(ctx, tc, state_machine)
1001
1003
  out = FFI::MemoryPointer.new(:int64)
1002
1004
  code = @hegel_state_machine_start_fn.call(ctx, tc, state_machine, out)
@@ -1009,9 +1011,18 @@ module Hegel
1009
1011
  # value: the caller compares against the sentinel, the same way
1010
1012
  # #run_result_status hands back its raw HEGEL_RUN_STATUS_* value
1011
1013
  # unexamined.
1014
+ #
1015
+ # Since libhegel 0.51.0, the call also writes the round's concurrency
1016
+ # level, which the engine can redraw between rounds. This method
1017
+ # discards it: for the machine #new_state_machine opens, the level is
1018
+ # always 1, so worker 0 gets rules in every round. The sequential
1019
+ # path of the Rust frontend (frontends/rust/src/stateful.rs) also
1020
+ # ignores the level. The engine writes through both pointers, so the
1021
+ # binding must pass a valid one for each.
1012
1022
  def state_machine_next_group(ctx, tc, state_machine)
1013
1023
  out = FFI::MemoryPointer.new(:int64)
1014
- code = @hegel_state_machine_next_group_fn.call(ctx, tc, state_machine, out)
1024
+ concurrency = FFI::MemoryPointer.new(:int64)
1025
+ code = @hegel_state_machine_next_group_fn.call(ctx, tc, state_machine, out, concurrency)
1015
1026
  LibHegel.check!(self, ctx, code)
1016
1027
  out.read_int64
1017
1028
  end
@@ -5,5 +5,5 @@ module Hegel
5
5
  # Hegel::VERSION (the gem's own release): hegel-go and hegel-typescript keep
6
6
  # the two separate too, so bumping the pinned engine can land as its own
7
7
  # commit without also releasing a new gem version.
8
- LIBHEGEL_VERSION = "0.50.0"
8
+ LIBHEGEL_VERSION = "0.51.5"
9
9
  end
data/lib/hegel/runner.rb CHANGED
@@ -202,9 +202,9 @@ module Hegel
202
202
  # Pulls test cases from +run+ until hegel_next_test_case reports none
203
203
  # left (a nil out-parameter, not an error). Never counts iterations
204
204
  # itself: test_cases bounds generation, not how many times shrinking
205
- # and rejected cases call the body. Measured against libhegel 0.50.0, a
205
+ # and rejected cases call the body. Measured against libhegel 0.51.5, a
206
206
  # run configured for 20 test cases whose body rejected nearly every case
207
- # took 791 to 1779 iterations over 30 runs. +stats+ does its own, different counting
207
+ # took 581 to 1768 iterations over 30 runs. +stats+ does its own, different counting
208
208
  # -- see GenerationStats above.
209
209
  def drive(impl, ctx, run, grammars, stats, captures, &block)
210
210
  loop do
@@ -526,7 +526,7 @@ module Hegel
526
526
  end
527
527
 
528
528
  # hegel_state_machine_start: seals the declarations and returns the
529
- # drawn concurrency level. No round may start before this call.
529
+ # number of workers to run. No round may start before this call.
530
530
  def state_machine_start(state_machine)
531
531
  @impl.state_machine_start(@ctx, live_handle, state_machine)
532
532
  end
data/lib/hegel/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hegel
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hegeltest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - meganemura