Module Tensor.For_testing

Diagnostics and negative controls for the checkpoint machinery's tests.

val restore_categories : Base.string Base.list
val trace_scheme : sabotage:Shape.Scheme.sabotage -> label:Base.string -> Base.int -> (t Base.list -> t Base.list) -> Scheme.t

Scheme.trace with one part of the mechanism disabled: negative controls.

val instantiate_scheme : sabotage:Shape.Scheme.sabotage -> ?application:Base.string -> Scheme.t -> args:Shape.t Base.list -> results:Shape.t Base.list -> Base.unit

Scheme.instantiate with one part of the mechanism disabled: negative controls.

val observe_schemes : (Base.unit -> 'a) -> on_event:(Scheme.event -> Base.unit) -> 'a

Runs the function, reporting the automatic schemes' events to on_event.

val set_op_shape_schemes : [ `Check | `Off ] Base.option -> Base.unit

Overrides the op_shape_schemes setting in-process (None: back to the setting).

val discarded_registry_sizes : Base.unit -> (Base.string * Base.int) Base.list

The records the session holds of what rewinds discarded, by kind (nodes, capture references, update steps). Call it after a full major collection to count only what is reachable.

val without_id_neutrality : (Base.unit -> 'a) -> 'a

Runs the function with the shape-scheme windows allocating session ids: a negative control of their id neutrality.

val rewind_omitting : omit:Base.string -> checkpoint -> Base.unit

rewind skipping one restore category: to show a test's oracle notices it.

val checkpoint_differences : checkpoint -> Base.string Base.list

The components of the session that differ from the checkpoint (physically; padding arrays by contents), by name.

val checkpoint_sizes : checkpoint -> (Base.string * Base.int) Base.list

The open frontier's sizes at the checkpoint.

val forward_conflicts_by_cells : t -> Base.string Base.list

The roots consume_forward_code would refuse t over, by name, as its owner cells say (gh-ocannl-1796).

val forward_conflicts_by_live_roots : t -> Base.string Base.list

The same, by the pre-gh-ocannl-1796 rule over the live forward roots: equal to forward_conflicts_by_cells while every root is held.

val owner_count : t -> Base.int

The number of owners t's forward owner cell records, as last compacted (the probe compacts nothing itself).