Skip to content

WriteFmt

Description

Write formatted output to the standard output stream (FileStdout()). This is a convenience macro calling FWriteFmt with FileStdout().

Parameters

Name Direction Description
fmtstr in Format string with {} placeholders.

Success

Placeholders in fmtstr are replaced by the passed arguments, and the resulting formatted string is written to standard output.

Failure

Failure might occur during memory allocation for the temporary string or during the write operation; the backend may also log an error message.

Usage example (Cross-references)

Usage examples (Cross-references)
    
    int main(void) {
        WriteFmt("[INFO] Starting PageProtect tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_file_read_into_str(void) {
        WriteFmt("Testing FileRead into Str (whole-file load)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    
    bool test_file_read_grows_str(void) {
        WriteFmt("Testing FileRead grows the Str backing buffer\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // rather than touching a stale fd.
    bool test_closed_file_ops_fail(void) {
        WriteFmt("Testing read/write/seek/tell on a closed file return errors\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // An invalid mode string yields a File that reports not-open.
    bool test_open_invalid_mode(void) {
        WriteFmt("Testing FileOpen with an invalid mode returns a not-open file\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // observable values.
    bool test_write_seek_read_roundtrip(void) {
        WriteFmt("Testing FileWrite/FileSeek/FileTell/FileRead round-trip\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // request returns 0 without touching eof.
    bool test_eof_semantics(void) {
        WriteFmt("Testing EOF detection and zero-length read\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // must see only the new (shorter) content, never leftover tail bytes.
    bool test_write_mode_truncates(void) {
        WriteFmt("Testing \"w\" mode truncates prior content\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // the end.
    bool test_append_mode_preserves(void) {
        WriteFmt("Testing \"a\" mode appends to prior content\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // the open+op+close convenience round-trip.
    bool test_write_and_read_and_close(void) {
        WriteFmt("Testing FileWriteAndClose + FileReadAndClose round-trip\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // failed) rather than a bogus byte count.
    bool test_read_and_close_missing_path(void) {
        WriteFmt("Testing FileReadAndClose on a missing path returns -1\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // would succeed. Real code: "r" is read-only, FileWrite returns -1.
    bool test_fm_46_plus_init_false(void) {
        WriteFmt("Testing parse_open_mode: \"r\" opens read-only (plus init false)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // file opens read-only and writes fail. Real code: "r+" is read+write.
    bool test_fm_48_rplus_is_writable(void) {
        WriteFmt("Testing parse_open_mode: \"r+\" is writable (== '+' detection)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // or stops behaving as a read-only handle on the seeded content.
    bool test_fm_56_r_mode_reads_content(void) {
        WriteFmt("Testing parse_open_mode: \"r\" mode reads the seeded content back\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // it back. A constant 42 would surface 42 regardless of the argument.
    bool test_fm_172_fromfd_keeps_fd(void) {
        WriteFmt("Testing FileFromFd preserves the fd value (FileFd round-trip)\n");
    
    #if PLATFORM_WINDOWS
    // temp file, FileClose the borrowed wrapper, then keep using the owner.
    bool test_fm_173_fromfd_does_not_own(void) {
        WriteFmt("Testing FileFromFd borrows (owns=false): close is a no-op on the fd\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // eq_to_ne on `r == 0` would report failure on a clean close.
    bool test_fm_222_close_returns_true(void) {
        WriteFmt("Testing FileClose returns true on a clean close (r == 0)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // would attempt to close fd -1 and could report failure.
    bool test_fm_228_double_close_clears_owns(void) {
        WriteFmt("Testing FileClose clears owns: second close is a no-op true\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // byte counts the read/write syscalls report.
    bool test_fm_249_read_exact_count(void) {
        WriteFmt("Testing FileRead returns the exact byte count for a partial read\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // L270 `f->at_eof = true`: a zero-byte read at EOF sets the eof flag.
    bool test_fm_270_read_sets_eof(void) {
        WriteFmt("Testing FileRead at EOF sets the eof flag\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // the eof flag so a subsequent read can succeed again.
    bool test_fm_317_seek_clears_eof(void) {
        WriteFmt("Testing FileSeek clears eof and returns the new offset\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // result return, line 328/332).
    bool test_fm_328_seek_cur_offset(void) {
        WriteFmt("Testing FileSeek SEEK_CUR returns the running absolute offset\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // right or the slurp drops/duplicates bytes.
    bool test_fm_403_remaining_size_from_midfile(void) {
        WriteFmt("Testing FileRead-to-EOF from a mid-file cursor reads only the tail\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // total when here == 0; guards the `end < here` and reserve logic).
    bool test_fm_394_remaining_size_full(void) {
        WriteFmt("Testing FileRead-to-EOF from start reads the whole file exactly\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // total and full content (guards the reserve-size and grow-loop).
    bool test_fm_427_read_to_buf_large(void) {
        WriteFmt("Testing FileRead-to-Buf slurps a multi-chunk payload exactly\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // content and length.
    bool test_fm_498_write_close_read_close_roundtrip(void) {
        WriteFmt("Testing FileWriteAndClose + FileReadAndClose exact round-trip\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // the file to empty (so a subsequent read-and-close returns 0).
    bool test_fm_498_zero_length_write(void) {
        WriteFmt("Testing FileWriteAndClose with n==0 writes nothing, truncates file\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // length and content.
    bool test_fm_514_write_close_from_buf(void) {
        WriteFmt("Testing FileWriteAndClose(Buf) writes the buffer length exactly\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // length and content.
    bool test_fm_521_write_close_from_str(void) {
        WriteFmt("Testing FileWriteAndClose(Str) writes the string length exactly\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // file with a non-empty path that round-trips a payload.
    bool test_fm_602_temp_open_roundtrips(void) {
        WriteFmt("Testing FileOpenTemp creates an open, writable, named file\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // hex name, owns the new fd).
    bool test_fm_547_temp_names_distinct(void) {
        WriteFmt("Testing two FileOpenTemp calls yield distinct, independent files\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // truthy would make the closed case wrongly report success.
    bool test_fm_347_flush_open_vs_closed(void) {
        WriteFmt("Testing FileFlush returns true open / false closed (open gate)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // deadend pins that the abort fires.
    bool test_fm_498_null_buf_positive_n_aborts(void) {
        WriteFmt("Testing FileWriteAndClose(NULL, 5) aborts (NULL-buf contract)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // FileIsOpen on fd 0, so the `>= 0` vs `> 0` boundary is unpinned there.
    bool test_mut_240_isopen_fd_zero(void) {
        WriteFmt("Testing FileIsOpen reports a borrowed fd 0 as open (>= 0 boundary)\n");
    
    #if PLATFORM_WINDOWS
    // non-NULL buffer, so it never exercises the `!buf` arm at n == 0.
    bool test_mut_498_null_buf_zero_n_ok(void) {
        WriteFmt("Testing FileWriteAndClose(path, NULL, 0) returns 0 (n > 0 guard)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    // ---------------------------------------------------------------------------
    bool test_close_releases_fd_slot(void) {
        WriteFmt("Testing FileClose actually releases the fd (slot is reused)\n");
    
        DefaultAllocator alloc      = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting File tests\n\n");
    
        TestFunction tests[] = {
    
    int main(void) {
        WriteFmt("[INFO] Starting Buf tests\n\n");
        TestFunction tests[] = {
            test_buf_init_clear,
    
    int main(void) {
        WriteFmt("[INFO] Starting AllocDebug tests\n\n");
    
        TestFunction normal[] = {
        bool ok = (StrLen(&out) == ZstrLen(expected)) && (ZstrCompare(StrBegin(&out), expected) == 0);
        if (!ok) {
            WriteFmt("[a1] help mismatch:\n");
            WriteFmt("---- expected ({} bytes) ----\n{}\n", ZstrLen(expected), expected);
            WriteFmt("---- actual   ({} bytes) ----\n{}\n", StrLen(&out), StrBegin(&out));
        if (!ok) {
            WriteFmt("[a1] help mismatch:\n");
            WriteFmt("---- expected ({} bytes) ----\n{}\n", ZstrLen(expected), expected);
            WriteFmt("---- actual   ({} bytes) ----\n{}\n", StrLen(&out), StrBegin(&out));
        }
            WriteFmt("[a1] help mismatch:\n");
            WriteFmt("---- expected ({} bytes) ----\n{}\n", ZstrLen(expected), expected);
            WriteFmt("---- actual   ({} bytes) ----\n{}\n", StrLen(&out), StrBegin(&out));
        }
        StrDeinit(&out);
                  ZstrFindSubstring(StrBegin(&out), "--opt64") == NULL;
        if (!ok) {
            WriteFmt("[a1] render cap: window wrong\n{}\n", StrBegin(&out));
        }
        StrDeinit(&out);
    // so left_col is populated, drive --help, and require live_count == 0.
    static bool test_help_frees_left_col_strs(void) {
        WriteFmt("Testing print_help frees per-spec left-column Strs (414:9)\n");
    
        DebugAllocator dbg  = DebugAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting ArgParse tests\n\n");
    
        TestFunction tests[] = {
    
    static bool test_graph_node_visit_scratch_state(void) {
        WriteFmt("Testing Graph node scratch visit state\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_mark_delete_commit_and_reuse(void) {
        WriteFmt("Testing GraphMarkNodeForDeletion and GraphCommitChanges\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_query_and_unmark_node_deletion(void) {
        WriteFmt("Testing Graph node mark query and unmark\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_mark_edge_for_removal(void) {
        WriteFmt("Testing GraphMarkEdgeForRemoval and deferred edge commit\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_query_and_unmark_edge_removal(void) {
        WriteFmt("Testing Graph edge mark query and unmark\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_partial_unmark_of_multiple_edge_removals(void) {
        WriteFmt("Testing partial unmark of multiple pending edge removals\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_self_loop_edge_removal(void) {
        WriteFmt("Testing deferred removal of self-loop edge\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_edge_removal_and_node_deletion_overlap(void) {
        WriteFmt("Testing overlap between pending edge removal and node deletion\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_external_indexed_state_requires_reset_on_reuse(void) {
        WriteFmt("Testing external slot-indexed state across delete and reuse\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_stale_node_handle_after_commit_deadend(void) {
        WriteFmt("Testing stale GraphNode handle after commit (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // caller-observable post-commit graph shape.
    static bool test_graph_commit_keeps_live_edge_before_removing_marked_edge(void) {
        WriteFmt("Testing commit keeps a live out-edge ordered before a marked-target edge\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // succeeds.
    static bool test_graph_clear_resets_free_slot_visit_count(void) {
        WriteFmt("Testing GraphClear resets free-slot visit_count\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // deletion).
    static bool test_graph_clear_empties_free_indices(void) {
        WriteFmt("Testing GraphClear empties free_indices before repopulating\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // slot and graph_validate_node_id aborts on "free slot". Real code skips it.
    static bool test_commit_with_free_slot_present_succeeds(void) {
        WriteFmt("Testing commit succeeds while a free-list slot is present\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // validation graph_find_pending_edge_removal_index just returns "not found".
    static bool test_edge_marked_stale_from_deadend(void) {
        WriteFmt("Testing GraphEdgeMarkedForRemoval rejects a stale from id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // valid `from` with a stale `to` must abort.
    static bool test_edge_marked_stale_to_deadend(void) {
        WriteFmt("Testing GraphEdgeMarkedForRemoval rejects a stale to id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // false rather than aborting.
    static bool test_unmark_edge_stale_from_deadend(void) {
        WriteFmt("Testing GraphUnmarkEdgeForRemoval rejects a stale from id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // valid `from` with a stale `to` must abort.
    static bool test_unmark_edge_stale_to_deadend(void) {
        WriteFmt("Testing GraphUnmarkEdgeForRemoval rejects a stale to id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // NORMAL: real completes; the mutant aborts (killing the process).
    static bool test_find_neighbor_index_no_overscan(void) {
        WriteFmt("Testing graph_find_neighbor_index does not overscan past the adjacency end\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // NORMAL: real completes (a deleted, c retained); the mutant aborts.
    static bool test_commit_pass2_no_overscan(void) {
        WriteFmt("Testing commit pass-2 does not over-walk the slot array\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // NORMAL: real completes (a deleted; c still marked + live); the mutant aborts.
    static bool test_commit_marked_passes_no_overscan(void) {
        WriteFmt("Testing commit marked passes do not over-walk the slot array\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting Graph.Ops tests\n\n");
        return run_test_suite(
            tests,
    
    static bool test_graph_reserve_clear(void) {
        WriteFmt("Testing GraphReserve and GraphClear\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_node_deep_copy(void) {
        WriteFmt("Testing Graph node deep-copy\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_node_owned_str_rvalue(void) {
        WriteFmt("Testing Graph node owned Str r-value insertion\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_init_optional_allocator(void) {
        WriteFmt("Testing Graph init optional allocator\n");
    
        typedef Graph(Str) StrGraph;
    // to at least the requested count.
    static bool test_graph_reserve_grows_capacity(void) {
        WriteFmt("Testing GraphReserve actually grows slot capacity\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Mark (but do not commit) an edge removal so a backing exists at teardown.
    static bool test_deinit_frees_pending_edge_removals_backing_no_leak(void) {
        WriteFmt("Testing GraphDeinit frees the pending-edge-removals backing (no leak)\n");
    
        DebugAllocator dbg = DebugAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting Graph.Init tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "Graph.Init");
    }
    
    static bool test_graph_add_node_semantics(void) {
        WriteFmt("Testing GraphAddNode semantics\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_add_edge_dedup(void) {
        WriteFmt("Testing GraphAddEdge deduplication\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_self_loop_and_predecessor_order(void) {
        WriteFmt("Testing Graph self-loop handling and predecessor order\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // detect concurrent structural mutation.
    static bool test_graph_reserve_growth_bumps_epoch(void) {
        WriteFmt("Testing GraphReserve growth bumps the mutation epoch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // mutation epoch, observable via GraphMutationEpoch.
    static bool test_graph_reuse_add_bumps_epoch(void) {
        WriteFmt("Testing successful slot-reuse add bumps the mutation epoch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // slot at a different index.
    static bool test_graph_failed_reuse_returns_slot_to_free_list(void) {
        WriteFmt("Testing failed reuse add returns the slot to the free list\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // bit) so the corrupted free slot is rejected.
    static bool test_graph_failed_reuse_resets_visit_count(void) {
        WriteFmt("Testing failed reuse add resets the freed slot visit count\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // failing add. Routed through a DebugAllocator.
    static bool test_push_grow_copy_failure_frees_node_data(void) {
        WriteFmt("Testing grow-path copy failure frees the node-data buffer (no leak)\n");
    
        DebugAllocator dbg = make_lean_debug_allocator();
    // slot, then drive a failing reuse add and assert the live count is net-zero.
    static bool test_push_reuse_copy_failure_frees_node_data(void) {
        WriteFmt("Testing reuse-path copy failure frees the node-data buffer (no leak)\n");
    
        DebugAllocator dbg = make_lean_debug_allocator();
        };
    
        WriteFmt("[INFO] Starting Graph.Insert tests\n\n");
        return run_test_suite(tests, (int)(sizeof(tests) / sizeof(tests[0])), NULL, 0, "Graph.Insert");
    }
    
    static bool test_graph_type_defaults(void) {
        WriteFmt("Testing Graph defaults\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_aligned_init_and_id_layout(void) {
        WriteFmt("Testing Graph aligned init and node id layout\n");
    
        HeapAllocator alloc = HeapAllocatorInitAligned(32);
    // validating this valid graph does NOT abort. NORMAL test.
    static bool test_graph_validate_passes_with_marked_node(void) {
        WriteFmt("Testing deep ValidateGraph accepts a valid graph that has a marked node\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // > 1), re-arm the deep validator, and assert ValidateGraph aborts. DEADEND.
    static bool test_graph_non_pow2_alignment_rejected_deadend(void) {
        WriteFmt("Testing ValidateGraph rejects a non-power-of-two allocator alignment (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // real code while removing the mask for the mutant). DEADEND.
    static bool test_graph_validate_catches_corrupt_slots_vec_deadend(void) {
        WriteFmt("Testing ValidateGraph catches a corrupted slots vector (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // does not mask the removed in-validator check (see slots-vec test). DEADEND.
    static bool test_graph_validate_catches_corrupt_free_indices_vec_deadend(void) {
        WriteFmt("Testing ValidateGraph catches a corrupted free_indices vector (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // check (see slots-vec test). DEADEND.
    static bool test_graph_validate_catches_corrupt_pending_edges_vec_deadend(void) {
        WriteFmt("Testing ValidateGraph catches a corrupted pending_edge_removals vector (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // if its index starts past the end). Kills 377:29 and 383:22.
    static bool test_graph_out_reverse_missing_predecessor_deadend(void) {
        WriteFmt("Testing validate_graph out-loop catches missing reverse predecessor (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // broken. A loop that visits only index 0 misses it. Kills 377:87 (i++ -> i--).
    static bool test_graph_out_reverse_second_neighbor_deadend(void) {
        WriteFmt("Testing validate_graph out-loop visits every out-neighbor (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // skipped wholesale if its index starts past the end). Kills 388:29 and 394:22.
    static bool test_graph_in_reverse_missing_outgoing_deadend(void) {
        WriteFmt("Testing validate_graph in-loop catches missing reverse outgoing edge (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // visits only index 0 of in_neighbors misses it. Kills 388:86 (i++ -> i--).
    static bool test_graph_in_reverse_second_predecessor_deadend(void) {
        WriteFmt("Testing validate_graph in-loop visits every predecessor (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // index starts past the end. Kills 417:23.
    static bool test_graph_free_index_points_to_occupied_deadend(void) {
        WriteFmt("Testing validate_graph free-index loop rejects occupied target (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // it to (index > len) lets this out-of-bounds index through. Kills 419:24.
    static bool test_graph_free_index_out_of_bounds_deadend(void) {
        WriteFmt("Testing validate_graph free-index loop rejects out-of-bounds index (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the first free index misses it. Kills 417:85 (i++ -> i--).
    static bool test_graph_free_index_second_entry_occupied_deadend(void) {
        WriteFmt("Testing validate_graph free-index loop visits every entry (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Kills 428:23.
    static bool test_graph_pending_removal_missing_edge_deadend(void) {
        WriteFmt("Testing validate_graph pending-removal loop rejects missing edge (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // first pending entry misses it. Kills 428:94 (i++ -> i--).
    static bool test_graph_pending_removal_second_entry_deadend(void) {
        WriteFmt("Testing validate_graph pending-removal loop visits every entry (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // is not an out-neighbor and force re-validation; real code aborts.
    static bool test_graph_validate_rejects_missing_pending_edge_deadend(void) {
        WriteFmt("Testing ValidateGraph rejects pending removal of a missing edge (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting Graph.Type tests\n\n");
        return run_test_suite(
            tests,
    
    static bool test_graph_city_reachability(void) {
        WriteFmt("Testing GraphForeachNode and GraphNodeForeachNeighbor for reachability\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_foreach_with_external_map_counts(void) {
        WriteFmt("Testing nested foreach with external count tracking map\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_foreach_predecessors(void) {
        WriteFmt("Testing GraphNodeForeachPredecessor\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_node_iteration_rejects_structural_mutation_deadend(void) {
        WriteFmt("Testing GraphForeachNode rejects structural mutation (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_neighbor_iteration_rejects_structural_mutation_deadend(void) {
        WriteFmt("Testing GraphNodeForeachNeighbor rejects structural mutation (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_predecessor_iteration_rejects_structural_mutation_deadend(void) {
        WriteFmt("Testing GraphNodeForeachPredecessor rejects structural mutation (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // iteration completes over both nodes.
    static bool test_graph_reserve_no_grow_keeps_iterator_valid(void) {
        WriteFmt("Testing in-capacity GraphReserve does not invalidate traversal\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // visits exactly the surviving nodes; the mutant visits the free slot too.
    static bool test_graph_foreach_skips_freed_slot(void) {
        WriteFmt("Testing GraphForeachNode visits only occupied slots after a commit\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // without bumping the epoch, so the only surviving defense is line 1030.
    static bool test_neighbor_iter_validates_neighbor_id_deadend(void) {
        WriteFmt("Testing neighbor iteration rejects a corrupted neighbor id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // id to generation 0 after begin.
    static bool test_predecessor_iter_validates_predecessor_id_deadend(void) {
        WriteFmt("Testing predecessor iteration rejects a corrupted predecessor id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // mutant begin returns cleanly. DEADEND.
    static bool test_neighbor_iter_begin_rejects_stale_handle_deadend(void) {
        WriteFmt("Testing graph_neighbor_iter_begin rejects a stale node handle (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // aborts. Mutant: no bump, no abort.
    static bool test_node_iteration_rejects_grow_mutation_deadend(void) {
        WriteFmt("Testing GraphForeachNode rejects a no-realloc slot-growing mutation (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // code aborts on the next iteration step.
    static bool test_graph_clear_during_traversal_aborts_deadend(void) {
        WriteFmt("Testing GraphClear during traversal invalidates iterator (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // aborts on the next iteration step -> DEADEND.
    static bool test_graph_commit_invalidates_live_iterator_deadend(void) {
        WriteFmt("Testing GraphCommitChanges invalidates a live node iterator (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Caller-observable via the GraphForeachNode visit count.
    static bool test_node_iter_no_overscan_extra_slot(void) {
        WriteFmt("Testing GraphForeachNode does not over-walk the slot array\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting Graph.Foreach tests\n\n");
        return run_test_suite(
            tests,
    
    static bool test_graph_access_helpers(void) {
        WriteFmt("Testing Graph access helpers\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_has_edge_query(void) {
        WriteFmt("Testing GraphHasEdge\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_cross_graph_node_handle_deadend(void) {
        WriteFmt("Testing GraphNodeData rejects foreign graph node handles (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_predecessor_access_oob_deadend(void) {
        WriteFmt("Testing GraphPredecessorAt out-of-bounds access (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_graph_neighbor_access_oob_deadend(void) {
        WriteFmt("Testing GraphNeighborAt out-of-bounds access (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // it as contained (true) -- a deterministic divergence.
    static bool test_contains_node_rejects_index_equal_to_slot_count(void) {
        WriteFmt("Testing GraphContainsNode rejects index == slot count\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // report as contained.
    static bool test_contains_node_free_slot_with_matching_generation(void) {
        WriteFmt("Testing GraphContainsNode rejects a freed slot whose generation matches\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // admits it.
    static bool test_graph_node_index_equal_to_slot_count_deadend(void) {
        WriteFmt("Testing node index equal to slot count is rejected (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // without aborting. Real code aborts on the stale id.
    static bool test_get_node_rejects_stale_id_deadend(void) {
        WriteFmt("Testing GraphGetNode rejects a stale node id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // a silent `false` instead of aborting on the caller bug.
    static bool test_has_edge_rejects_invalid_destination_deadend(void) {
        WriteFmt("Testing GraphHasEdge rejects an invalid destination id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // return without aborting.
    static bool test_node_at_stale_id_deadend(void) {
        WriteFmt("Testing GraphNodeAt rejects a stale node id (should abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Real code aborts; mutant proceeds. DEADEND.
    static bool test_validate_node_id_rejects_free_slot_matching_generation_deadend(void) {
        WriteFmt("Testing graph_validate_node_id rejects a free slot whose generation matches (abort)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        };
    
        WriteFmt("[INFO] Starting Graph.Access tests\n\n");
        return run_test_suite(
            tests,
    
    bool test_float_compare_small_small(void) {
        WriteFmt("Testing FloatCompare with small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_compare_very_large_large(void) {
        WriteFmt("Testing FloatCompare with very large floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_compare_very_large_small(void) {
        WriteFmt("Testing FloatCompare with very large and small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_compare_wrappers(void) {
        WriteFmt("Testing Float compare macros\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_compare_generic(void) {
        WriteFmt("Testing FloatCompare generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Two construction paths for the same value must hash to the same bucket.
    bool test_float_hash_determinism(void) {
        WriteFmt("Testing float_hash determinism\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // +1.5e3 / -1.5e3 / 1.5e2 all land in distinct buckets.
    bool test_float_hash_distinguishes(void) {
        WriteFmt("Testing float_hash sensitivity to sign / exponent / magnitude\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the GenericHash / GenericCompare-shaped helpers wire in directly.
    bool test_float_hash_as_map_key(void) {
        WriteFmt("Testing float_hash as Map<Float, u64> key\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the emulated mutant -- demonstrating equivalence, not a kill.
    static bool test_ff_probe_compare_error_paths(void) {
        WriteFmt("Probe: with-error compare keeps error=false on success\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // both-zero branch and returns 0 instead of the correct +1.
    static bool test_m5_compare_nonzero_vs_zero(void) {
        WriteFmt("Testing FloatCompare(5.0, 0.0) is strictly greater\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the both-zero branch and returns 0 instead of the correct -1.
    static bool test_m5_compare_zero_vs_nonzero(void) {
        WriteFmt("Testing FloatCompare(0.0, 5.0) is strictly less\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // real ordering. Asserting the exact ordering value (+1) catches it.
    static bool test_m6_compare_u64_greater(void) {
        WriteFmt("Testing FloatCompare(Float, u64) returns +1 when greater\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Equality path: real code returns 0. A 42 return would fail this exact check.
    static bool test_m6_compare_u64_equal(void) {
        WriteFmt("Testing FloatCompare(Float, u64) returns 0 when equal\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Less-than path: real code returns -1. The mutated return of 42 fails this.
    static bool test_m6_compare_u64_less(void) {
        WriteFmt("Testing FloatCompare(Float, u64) returns -1 when less\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // while also pinning the error contract on the success path.
    static bool test_m6_compare_u64_no_error_flag(void) {
        WriteFmt("Testing FloatCompare(Float, u64, &error) clears error on success\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    static bool test_m8_compare_int_error_cleared(void) {
        WriteFmt("Testing float_compare_int_with_error clears error and orders correctly\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    static bool test_m8_compare_i64_error_cleared(void) {
        WriteFmt("Testing float_compare_i64_with_error clears error and orders correctly\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //
    static bool test_m8_compare_f32_error_cleared(void) {
        WriteFmt("Testing float_compare_f32_with_error clears error and orders correctly\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // apart under the real xor mixing but collide under the `|=` mutant.
    bool test_blind_746_hash_exponent_xor(void) {
        WriteFmt("Testing float_hash exponent xor mixing (1 vs 1e2)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // under the `|=` mutant.
    bool test_blind_750_hash_sign_xor(void) {
        WriteFmt("Testing float_hash sign xor mixing (3.14 vs -3.14)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // collide under the `|=` mutant but differ under real.
    bool test_blind_750_hash_sign_xor_int(void) {
        WriteFmt("Testing float_hash sign xor mixing (2 vs -2)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the built library and reading the result.
    bool test_blind_745_hash_loop_bound(void) {
        WriteFmt("Testing float_hash exponent loop bound (hash of 1)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // kill from depending on a single magic constant.
    bool test_blind_745_hash_loop_bound_zero(void) {
        WriteFmt("Testing float_hash exponent loop bound (hash of 0)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Float.Compare tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_float_init(void) {
        WriteFmt("Testing FloatInit\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_clear(void) {
        WriteFmt("Testing FloatClear\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_clone(void) {
        WriteFmt("Testing FloatClone\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_clone_inherits_allocator_config(void) {
        WriteFmt("Testing FloatClone allocator inheritance\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // The assign-const mutant sets it to 42 -> FloatExponent != 0 -> killed.
    static bool test_m10_normalize_zero_exponent(void) {
        WriteFmt("Testing float_normalize canonicalises zero exponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // diverges from the FloatInit zero -> test fails -> mutant killed.
    bool test_ff_254_normalized_zero_sign_is_positive(void) {
        WriteFmt("Testing float_normalize canonical-zero sign (mutant 254)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // unchanged. This probe keeps passing under the emulated removal.
    bool test_ff_probe_to_int_negative(void) {
        WriteFmt("Probe: FloatToInt returns false for negative input\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // are both caller-observable, so the mutation is distinguished.
    bool test_m2_to_int_neg_exponent_exact(void) {
        WriteFmt("Testing FloatToInt on un-normalized 50e-1 (== 5)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Exercises the non-negative-exponent branch: 12 x 10^1 == 120.
    bool test_m2_to_int_integer_branch(void) {
        WriteFmt("Testing FloatToInt on 120 (exponent branch)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Exercises the zero branch: result must be 0 and the call must succeed.
    bool test_m2_to_int_zero(void) {
        WriteFmt("Testing FloatToInt on 0\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Exercises the negative branch: FloatToInt rejects negative inputs.
    bool test_m2_to_int_negative_rejected(void) {
        WriteFmt("Testing FloatToInt rejects -7\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // exponent branch; the mutant fails to recognise 'E' and rejects the string.
    bool test_m3_uppercase_exponent_marker(void) {
        WriteFmt("Testing FloatTryFromStr handles uppercase 'E' exponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // exact resulting exponent.
    bool test_m3_min_exponent_boundary(void) {
        WriteFmt("Testing FloatTryFromStr accepts the INT64_MIN exponent boundary\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // printed string.
    bool test_m5_from_double_large_integer_exponent_zero(void) {
        WriteFmt("Testing FloatFrom(double) of a large integer keeps exponent 0\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Float.Type tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_float_negate_abs(void) {
        WriteFmt("Testing FloatNegate and FloatAbs\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_add_small_small(void) {
        WriteFmt("Testing FloatAdd with small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_add_very_large_large(void) {
        WriteFmt("Testing FloatAdd with very large floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_add_generic(void) {
        WriteFmt("Testing FloatAdd generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_sub_small_small(void) {
        WriteFmt("Testing FloatSub with small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_sub_very_large_large(void) {
        WriteFmt("Testing FloatSub with very large floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_sub_generic(void) {
        WriteFmt("Testing FloatSub generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_mul_small_small(void) {
        WriteFmt("Testing FloatMul with small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_mul_very_large_small(void) {
        WriteFmt("Testing FloatMul with very large and small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_mul_generic(void) {
        WriteFmt("Testing FloatMul generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_div_small_small(void) {
        WriteFmt("Testing FloatDiv with small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_div_very_large_small(void) {
        WriteFmt("Testing FloatDiv with very large and small floats\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_div_generic(void) {
        WriteFmt("Testing FloatDiv generic dispatch\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_div_by_zero(void) {
        WriteFmt("Testing FloatDiv divide-by-zero handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Real: -2 + 5 = 3. Mutant: -3.
    bool test_m1_add_neg_lhs_larger_pos_rhs(void) {
        WriteFmt("Testing FloatAdd sign: -2 + 5 = 3\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // the mutant; kept for behavioral coverage of the cmp<0 branch.
    bool test_m1_add_pos_lhs_larger_neg_rhs(void) {
        WriteFmt("Testing FloatAdd sign: 2 + (-5) = -3\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // yield -0.75.
    bool test_m1_add_sign_from_larger_magnitude(void) {
        WriteFmt("Testing FloatAdd sign w/ fractions: -0.25 + 1 = 0.75\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // gt_to_ge mutant the guard fires LOG_FATAL and the process aborts -> killed.
    static bool test_m10_mul_exp_max_boundary(void) {
        WriteFmt("Testing exponent-sum at INT64_MAX boundary (FloatMul)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // lt_to_le mutant aborts -> killed.
    static bool test_m10_mul_exp_min_boundary(void) {
        WriteFmt("Testing exponent-sum at INT64_MIN boundary (FloatMul)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // exponent; the lt_to_le mutant aborts -> killed.
    static bool test_m10_div_exp_min_boundary(void) {
        WriteFmt("Testing exponent-diff at INT64_MIN boundary (FloatDiv)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // boundary exponent; the gt_to_ge mutant aborts -> killed.
    static bool test_m10_div_exp_max_boundary(void) {
        WriteFmt("Testing exponent-diff at INT64_MAX boundary (FloatDiv)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // (call -> 42) mutants force ok truthy -> FloatDiv returns true -> killed.
    static bool test_m10_div_f64_by_zero_returns_false(void) {
        WriteFmt("Testing float_div_f64 propagates divide-by-zero failure\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   whose low bit is 0, so a negative input would lose its sign.
    bool test_m11_f32_sign(void) {
        WriteFmt("Testing float_try_from_f32_value sign bit\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   well below 1, but the mutant lands far above it.
    bool test_m11_f32_denormal_exp(void) {
        WriteFmt("Testing float_try_from_f32_value denormal exponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   distinct subnormals (m=1 vs m=3) would compare equal.
    bool test_m11_f32_denormal_mantissa(void) {
        WriteFmt("Testing float_try_from_f32_value denormal mantissa\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   `(bits >> 63) & 1ull` computes the IEEE sign bit; `<<` loses it.
    bool test_m11_f64_sign(void) {
        WriteFmt("Testing float_try_from_f64_value sign bit\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   produce `mantissa << 42` instead of a tiny subnormal.
    bool test_m11_f64_denormal_exp(void) {
        WriteFmt("Testing float_try_from_f64_value denormal exponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    //   subnormals to one value.
    bool test_m11_f64_denormal_mantissa(void) {
        WriteFmt("Testing float_try_from_f64_value denormal mantissa\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m12_div_int_by_zero_returns_false(void) {
        WriteFmt("Testing FloatDiv(Int 0) returns false\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m12_div_i64_by_zero_returns_false(void) {
        WriteFmt("Testing FloatDiv(i64 0) returns false\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m12_div_f32_by_zero_returns_false(void) {
        WriteFmt("Testing FloatDiv(f32 0) returns false\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // leading '+' must yield a positive value.
    bool test_m3_leading_plus_is_positive(void) {
        WriteFmt("Testing FloatTryFromStr keeps leading-'+' positive\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // succeed and produce the right value.
    bool test_m3_digit_nine_accepted(void) {
        WriteFmt("Testing FloatTryFromStr accepts the digit '9'\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_m4_div_sanity(void) {
        WriteFmt("Testing float_div sanity (6/3=2, exact)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m9_div_u64_by_zero_returns_false(void) {
        WriteFmt("Testing FloatDiv(u64) divide-by-zero returns false\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m9_div_u64_by_zero_leaves_result_unchanged(void) {
        WriteFmt("Testing FloatDiv(u64) divide-by-zero keeps result zero\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    ///
    bool test_m9_div_u64_exact(void) {
        WriteFmt("Testing FloatDiv(u64) exact quotient\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Float.Math tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_float_from_unsigned_integer(void) {
        WriteFmt("Testing FloatFrom with unsigned integer\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_from_signed_integer(void) {
        WriteFmt("Testing FloatFrom with signed integer\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_from_int_container(void) {
        WriteFmt("Testing FloatFrom with Int container\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_to_int_exact(void) {
        WriteFmt("Testing FloatToInt exact conversion\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_to_int_fractional_failure(void) {
        WriteFmt("Testing FloatToInt fractional failure handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_to_int_negative_failure(void) {
        WriteFmt("Testing FloatToInt negative failure handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_string_round_trip(void) {
        WriteFmt("Testing Float string round trip\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_try_to_str_allocator_inheritance(void) {
        WriteFmt("Testing FloatTryToStr allocator behavior\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_very_large_string_round_trip(void) {
        WriteFmt("Testing Float very large string round trip\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_scientific_parse(void) {
        WriteFmt("Testing Float scientific parsing\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_from_str_invalid(void) {
        WriteFmt("Testing FloatFromStr invalid format handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_from_str_null(void) {
        WriteFmt("Testing FloatFromStr NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_try_from_str_null(void) {
        WriteFmt("Testing FloatTryFromStr NULL handling\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // mutant (negative -> 42, truthy) flips that byte -> hashes differ -> killed.
    static bool test_m10_normalize_zero_sign_hash(void) {
        WriteFmt("Testing float_normalize canonicalises zero sign\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // un-normalized (mutant) result reports exponent 0.
    static bool test_m13_from_int_normalizes_exponent(void) {
        WriteFmt("Testing float_from_int trims trailing zeros (exponent)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // changes the value rather than just the representation.
    static bool test_m13_from_int_value_preserved(void) {
        WriteFmt("Testing float_from_int preserves numeric value\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // confirm the normalized representation still renders correctly.
    static bool test_m13_from_int_negative_value(void) {
        WriteFmt("Testing float_from_int on multi-zero value then negate\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // trailing garbage even if it stringifies as a terminator.
    static bool test_m6_to_str_neg_exp_split(void) {
        WriteFmt("Testing FloatToStr fractional loop bound for 3.14\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // terminates. Asserting exact text and length 5 catches all three.
    static bool test_m6_to_str_leading_zeros(void) {
        WriteFmt("Testing FloatToStr leading-zero loop for 0.001\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // trailing zeros exactly. Guards the positive-exponent path of float_try_to_str.
    static bool test_m6_to_str_positive_exp(void) {
        WriteFmt("Testing FloatToStr positive-exponent trailing zeros for 100\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // (saw_digit -> truthy) would accept it.
    static bool test_fg_465_digitless_dot_rejected(void) {
        WriteFmt("Testing float_try_from_str rejects digitless \".\"\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_fg_465_digitless_sign_dot_rejected(void) {
        WriteFmt("Testing float_try_from_str rejects digitless \"+.\"\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    static bool test_fg_465_with_digit_accepted(void) {
        WriteFmt("Testing float_try_from_str still accepts \"1.\"\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // constructed Float against the Int 2^52 distinguishes them.
    bool test_blind_93_ieee_binexp_zero_exponent(void) {
        WriteFmt("Testing float_try_from_ieee_bits binexp==0 exponent (2^52)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // integer form. Under the exponent=42 mutant it would gain 42 trailing zeros.
    bool test_blind_93_ieee_binexp_zero_render(void) {
        WriteFmt("Testing float_try_from_ieee_bits binexp==0 render (2^52)\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Float.Convert tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_float_is_zero(void) {
        WriteFmt("Testing FloatIsZero\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_is_negative(void) {
        WriteFmt("Testing FloatIsNegative\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    bool test_float_exponent(void) {
        WriteFmt("Testing FloatExponent\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
    int main(void) {
        WriteFmt("[INFO] Starting Float.Access tests\n\n");
    
        TestFunction tests[] = {
    
    bool test_vec_swap_items(void) {
        WriteFmt("Testing VecSwapItems\n");
    
        // Create a vector of integers
    // Test VecReverse function
    bool test_vec_reverse(void) {
        WriteFmt("Testing VecReverse\n");
    
        // Create a vector of integers
    // Test VecSort function
    bool test_vec_sort(void) {
        WriteFmt("Testing VecSort\n");
    
        // Create a vector of integers
    // code LOG_FATALs on idx2 == length.
    bool test_swap_idx_equal_length_aborts(void) {
        WriteFmt("Testing swap rejects idx == length\n");
    
        typedef Vec(u32) U32Vec;
    //   it swaps an out-of-bounds slot -- so the abort must come from real code.
    bool test_swap_idx1_equal_length_aborts(void) {
        WriteFmt("Testing swap rejects idx1 == length (476:14)\n");
    
        typedef Vec(u32) U32Vec;
    int main(void) {
        alloc = DefaultAllocatorInit();
        WriteFmt("[INFO] Starting Vec.Ops tests\n\n");
    
        // Array of test functions
    
    bool test_complex_vec_init(void) {
        WriteFmt("Testing vector initialization with complex structure\n");
    
        // Create a vector of ComplexItem with deep copy functions
    // Test push operations with complex structure
    bool test_complex_vec_push(void) {
        WriteFmt("Testing push operations with complex structure\n");
    
        // Create a vector of ComplexItem with deep copy functions
    // Test insert operations with complex structure
    bool test_complex_vec_insert(void) {
        WriteFmt("Testing insert operations with complex structure\n");
    
        // Create a vector of ComplexItem with deep copy functions
    // Test merge operations with complex structure
    bool test_complex_vec_merge(void) {
        WriteFmt("Testing merge operations with complex structure\n");
    
        // Create two vectors of ComplexItem with deep copy functions
    // Test L-value operations
    bool test_lvalue_operations(void) {
        WriteFmt("Testing L-value operations\n");
    
        // Create a vector of integers
    // Test fast operations
    bool test_fast_operations(void) {
        WriteFmt("Testing fast operations\n");
    
        // Create a vector of integers
    // Test delete operations
    bool test_delete_operations(void) {
        WriteFmt("Testing delete operations\n");
    
        // Create a vector of integers
    // Test edge cases
    bool test_edge_cases(void) {
        WriteFmt("Testing edge cases\n");
    
        // Create a vector of integers
    // Test VecPushBackL zero-on-take behavior with complex structures
    bool test_lvalue_zero_on_take_pushback(void) {
        WriteFmt("Testing VecPushBackL zero-on-take with complex structures\n");
    
        // Create a test item
    // Test VecInsertL zero-on-take behavior with complex structures
    bool test_lvalue_zero_on_take_insert(void) {
        WriteFmt("Testing VecInsertL zero-on-take with complex structures\n");
    
        // Create a test item
    // Test VecInsertFastL zero-on-take behavior with complex structures
    bool test_lvalue_zero_on_take_fast_insert(void) {
        WriteFmt("Testing VecInsertFastL zero-on-take with complex structures\n");
        bool result = true;
    // Test VecPushFrontL zero-on-take behavior with complex structures
    bool test_lvalue_zero_on_take_pushfront(void) {
        WriteFmt("Testing VecPushFrontL zero-on-take with complex structures\n");
    
        // Create a test item
    // Test VecMergeL zero-on-take behavior with complex structures
    bool test_lvalue_zero_on_take_merge(void) {
        WriteFmt("Testing VecMergeL zero-on-take with complex structures\n");
    
        // Create a vector with no copy_init but with copy_deinit for proper cleanup
    // Test array operations with L-value semantics
    bool test_lvalue_zero_on_take_array_ops(void) {
        WriteFmt("Testing array operations with L-value semantics\n");
    
        // Create a vector with no copy_init but with copy_deinit for proper cleanup
    // clone_vec @ 201:21 (==0 -> !=0): a non-empty src must be fully cloned.
    bool test_clone_copies_first_element(void) {
        WriteFmt("Testing clone copies a non-empty source\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // clone_vec @ 209:15 (copy loop init 0 -> const 42).
    bool test_clone_includes_index_zero(void) {
        WriteFmt("Testing clone copy loop starts at index zero\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // clone_vec @ 209:24 (i < length -> i >= length).
    bool test_clone_loop_runs_for_nonempty(void) {
        WriteFmt("Testing clone copy loop condition\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // clone_vec @ 209:40 (i++ -> i--).
    bool test_clone_visits_every_element(void) {
        WriteFmt("Testing clone visits every source element\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // clone_vec @ 210:14 (insert_range_into_vec(...) call replaced by 0).
    bool test_clone_insert_populates_dst(void) {
        WriteFmt("Testing clone appends each element to dst\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    int main(void) {
        alloc = DefaultAllocatorInit();
        WriteFmt("[INFO] Starting Vec.Complex tests\n\n");
    
        // Array of test functions
    // Test VecTryReduceSpace function
    bool test_vec_try_reduce_space(void) {
        WriteFmt("Testing VecTryReduceSpace\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecResize function
    bool test_vec_resize(void) {
        WriteFmt("Testing VecResize\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecReserve function
    bool test_vec_reserve(void) {
        WriteFmt("Testing VecReserve\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecClear function
    bool test_vec_clear(void) {
        WriteFmt("Testing VecClear\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // 125:67 cxx_mul_to_div (grown-region zero byte count collapses to ~0).
    bool test_reserve_zero_low_slot(void) {
        WriteFmt("Testing reserve zeroes grown region (low slot)\n");
        return reserve_zero_grown_region(9);
    }
    // 125:72 cxx_add_to_sub (`(n + 1 - old_capacity)` -> `(n - 1 - old_capacity)`).
    bool test_reserve_zero_high_slot(void) {
        WriteFmt("Testing reserve zeroes grown region (high slot)\n");
        return reserve_zero_grown_region(11);
    }
    // 112:42 cxx_gt_to_ge -- multiplicative-overflow guard boundary.
    bool test_reserve_overflow_boundary_returns_false(void) {
        WriteFmt("Testing reserve at the overflow boundary returns false (112:42)\n");
    
        HeapAllocator heap = HeapAllocatorInit(); // alignment 1 -> aligned_size == 1
    // Str the buffer -- including the NUL sentinel -- must be zeroed.
    bool test_clear_str_scrubs_sentinel(void) {
        WriteFmt("Testing VecClear scrubs Str sentinel byte\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // mutation. A one-character Str has capacity == 1 exactly.
    bool test_clear_str_cap1_scrubs_sentinel(void) {
        WriteFmt("Testing VecClear scrubs single-char Str (capacity 1)\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // clear_vec @ 84:18 / 84:20 (scrub MemSet stride forced to 42).
    bool test_clear_large_char_vec_scrub_stride(void) {
        WriteFmt("Testing VecClear scrub stride on a large char vector\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // once per live element.
    bool test_clear_runs_deinit_once_per_element(void) {
        WriteFmt("Testing VecClear invokes copy_deinit once per element\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // reduce_space_vec @ 165:18 (aligned_size := const 42 in the length>0 path).
    bool test_reduce_nonempty_preallocated_keeps_data(void) {
        WriteFmt("Testing reduce keeps element data for wide elements\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // reduce_space_vec @ 166:21 (length == 0 -> length != 0).
    bool test_reduce_nonempty_keeps_length(void) {
        WriteFmt("Testing reduce preserves length of a non-empty vec\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // reduce_space_vec @ 169:23 (capacity := const in the length==0 path).
    bool test_reduce_empty_capacity_zero(void) {
        WriteFmt("Testing reduce of an empty vec zeroes capacity\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // reduce_space_vec @ 170:23 (length := const in the length==0 path).
    bool test_reduce_empty_length_zero(void) {
        WriteFmt("Testing reduce of an empty vec keeps length zero\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // reduce_space_vec @ 188:23 (capacity := vec->length replaced by a const).
    bool test_reduce_shrinks_capacity_to_length(void) {
        WriteFmt("Testing reduce shrinks capacity to length\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // length > capacity.
    bool test_validate_rejects_length_over_capacity(void) {
        WriteFmt("Testing validate rejects length > capacity\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // wraps to a small allocation and later element writes run off the buffer.
    bool test_vec_reserve_capacity_overflow_aborts(void) {
        WriteFmt("Testing VecReserve capacity*item_size overflow aborts\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Vec.Memory tests\n\n");
    
        alloc = DefaultAllocatorInit();
    // Test basic vector initialization
    bool test_vec_init_basic(void) {
        WriteFmt("Testing VecInit\n");
    
        // Test with int type
    // Test aligned vector initialization
    bool test_vec_init_aligned(void) {
        WriteFmt("Testing VecInit with aligned allocator\n");
    
        HeapAllocator aligned4  = HeapAllocatorInitAligned(4);
    // Test vector initialization with deep copy functions
    bool test_vec_init_with_deep_copy(void) {
        WriteFmt("Testing VecInitWithDeepCopy\n");
    
        // Test with struct type and custom copy/deinit functions
    // Test vector initialization with alignment and deep copy functions
    bool test_vec_init_aligned_with_deep_copy(void) {
        WriteFmt("Testing VecInit with aligned allocator and deep copy\n");
    
        HeapAllocator aligned8 = HeapAllocatorInitAligned(8);
    // Test vector initialization variants with an explicit optional allocator
    bool test_vec_init_optional_allocator(void) {
        WriteFmt("Testing VecInit optional allocator\n");
    
        typedef Vec(TestItem) TestVec;
    // Test vector stack initialization
    bool test_vec_init_stack(void) {
        WriteFmt("Testing VecInitStack\n");
    
        bool result = true;
    // Test vector clone initialization
    bool test_vec_init_clone(void) {
        WriteFmt("Testing vector cloning\n");
    
        // Create a source vector
    // element before storage is freed.
    bool test_deinit_runs_deinit_once_per_element(void) {
        WriteFmt("Testing VecDeinit invokes copy_deinit once per element\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Vec.Init tests\n\n");
    
        alloc = DefaultAllocatorInit();
    
    bool test_vec_push_back(void) {
        WriteFmt("Testing VecPushBack\n");
    
        // Create a vector of integers
    // Test VecPushFront function
    bool test_vec_push_front(void) {
        WriteFmt("Testing VecPushFront\n");
    
        // Create a vector of integers
    // Test VecInsert function
    bool test_vec_insert(void) {
        WriteFmt("Testing VecInsert\n");
    
        // Create a vector of integers
    // Test VecPushBackArr function
    bool test_vec_push_back_arr(void) {
        WriteFmt("Testing VecPushBackArr\n");
    
        // Create a vector of integers
    // Test VecPushFrontArr function
    bool test_vec_push_front_arr(void) {
        WriteFmt("Testing VecPushFrontArr\n");
    
        // Create a vector of integers
    // Test VecInsertRange function for inserting at a specific index
    bool test_vec_push_arr(void) {
        WriteFmt("Testing VecInsertRange at specific index\n");
    
        // Create a vector of integers
    // Test VecInsertRange function for inserting from another vector
    bool test_vec_insert_range(void) {
        WriteFmt("Testing VecInsertRange from another vector\n");
    
        // Create a vector of integers
    // Test VecMerge function
    bool test_vec_merge(void) {
        WriteFmt("Testing VecMerge\n");
    
        // Create a vector of integers
    // the elements manually.)
    bool test_vec_init_clone_inherits_allocator_config(void) {
        WriteFmt("Testing manual clone allocator inheritance\n");
    
        typedef Vec(int) IntVec;
    // Test L-value and R-value operations
    bool test_lvalue_rvalue_operations(void) {
        WriteFmt("Testing L-value and R-value operations\n");
    
        // Create a vector of integers
    // Test that L-value insertions properly zero out values after insertion
    bool test_lvalue_zero_on_take_after_insertion(void) {
        WriteFmt("Testing L-value zero-on-take after insertion\n");
    
        // Create a vector of integers without copy_init
    // untouched prefix [0, idx) is intact.
    bool test_vec_insert_range_fast_overflowing_tail(void) {
        WriteFmt("Testing VecInsertRangeFast with count > (length - idx)\n");
    
        typedef Vec(int) IntVec;
    // mutant `>=` turns the boundary into a LOG_FATAL.
    bool test_fast_overflow_count_returns_false(void) {
        WriteFmt("Testing fast-insert SIZE_MAX count returns false (no abort)\n");
    
        ElemVec vec = VecInit(&alloc);
    // elements land correctly.
    bool test_grow_skip_underflow_predicate(void) {
        WriteFmt("Testing fast-insert grows when length+count reaches capacity\n");
    
        typedef Vec(int) IntVec;
    // post-insert capacity was actually bumped past the old non-pow2 value.
    bool test_grow_predicate_boundary_equal(void) {
        WriteFmt("Testing fast-insert grows at length+count == capacity boundary\n");
    
        typedef Vec(int) IntVec;
    // reservation, writing into a NULL/tiny buffer. Insert into an empty vec.
    bool test_grow_predicate_inverted(void) {
        WriteFmt("Testing fast-insert grows an empty vector\n");
    
        typedef Vec(int) IntVec;
    // realloc. A growth-needing insert must return true with all elements present.
    bool test_grow_reserve_result_honored(void) {
        WriteFmt("Testing fast-insert honors reserve growth result\n");
    
        typedef Vec(int) IntVec;
    // preserve every displaced original after the inserted block.
    bool test_displacement_move_size(void) {
        WriteFmt("Testing fast-insert preserves displaced tail (aligned_size)\n");
    
        ElemVec vec = VecInit(&alloc); // no copy hooks: plain MemCopy path
    // stays in bounds, producing the front-insert layout.
    bool test_displacement_move_overcopy(void) {
        WriteFmt("Testing fast-insert displacement move stays in bounds (over-copy)\n");
    
        ElemVec vec = VecInit(&alloc); // no copy hooks: plain MemCopy path
    // the untouched prefix [0, idx) survives a copy_init middle insert.
    bool test_prezero_target_index(void) {
        WriteFmt("Testing fast-insert leaves prefix intact (pre-zero index)\n");
    
        ElemVec vec = make_filled_elem_vec(10, 4); // values 10,11,12,13
    // block holds the source items in order and prefix is intact.
    bool test_copy_init_dest_index(void) {
        WriteFmt("Testing fast-insert copy_init destination index\n");
    
        ElemVec vec = make_filled_elem_vec(10, 4); // 10,11,12,13
    // slot equals its distinct source element.
    bool test_copy_init_source_stride(void) {
        WriteFmt("Testing fast-insert copy_init source stride\n");
    
        ElemVec vec = make_filled_elem_vec(10, 2); // 10,11
    // non-zero seed makes the rollback deinit never-inited slots.
    bool test_first_element_failure_no_deinit(void) {
        WriteFmt("Testing fast-insert first-element failure runs no deinit\n");
    
        ElemVec vec = make_filled_elem_vec(10, 4); // 10,11,12,13
    // one copy_deinit (on idx+0) must fire. A non-zero start skips it -> leak.
    bool test_rollback_start_index_zero(void) {
        WriteFmt("Testing fast-insert rollback starts at slot 0\n");
    
        ElemVec vec = make_filled_elem_vec(10, 4); // 10,11,12,13
    // or records a flood of deinits.
    bool test_rollback_guard_first_fail(void) {
        WriteFmt("Testing fast-insert rollback guard on first failure\n");
    
        ElemVec vec = make_filled_elem_vec(10, 4);
    // equals the number of successful copies and every deinit hit a live slot.
    bool test_rollback_guard_no_extra_deinit(void) {
        WriteFmt("Testing fast-insert rollback deinits only inited slots\n");
    
        ElemVec vec = make_filled_elem_vec(10, 5); // 10..14
    // must be deinited.
    bool test_rollback_counter_increments(void) {
        WriteFmt("Testing fast-insert rollback counter advances\n");
    
        ElemVec vec = make_filled_elem_vec(10, 5);
    // prefix originals.
    bool test_rollback_deinit_target(void) {
        WriteFmt("Testing fast-insert rollback deinit target index\n");
    
        ElemVec vec = make_filled_elem_vec(10, 5); // 10..14
    // failure must yield exactly one deinit.
    bool test_inserted_counter_increments(void) {
        WriteFmt("Testing fast-insert success counter advances\n");
    
        ElemVec vec = make_filled_elem_vec(10, 4);
    // failed middle insert the original tail must be intact.
    bool test_rollback_restore_source_first_term(void) {
        WriteFmt("Testing fast-insert rollback restore source (first term)\n");
    
        ElemVec vec = make_filled_elem_vec(10, 5); // 10,11,12,13,14
    // reads past the parked block, restoring garbage. Original tail must survive.
    bool test_rollback_restore_source_second_term(void) {
        WriteFmt("Testing fast-insert rollback restore source (second term)\n");
    
        ElemVec vec = make_filled_elem_vec(20, 5); // 20,21,22,23,24
    // is restored. Assert every displaced original survives a failed insert.
    bool test_rollback_restore_size(void) {
        WriteFmt("Testing fast-insert rollback restore size\n");
    
        ElemVec vec = make_filled_elem_vec(30, 6); // 30..35
    // 234:15  cxx_gt_to_ge : `count > (size)-1 - length` overflow guard.
    bool test_insert_overflow_count_returns_false(void) {
        WriteFmt("Testing insert with count == SIZE_MAX returns false (no overflow)\n");
    
        U64Vec vec = VecInit(&alloc);
    // 238:18  cxx_assign_const : `aligned_size = vec_aligned_size(...)` -> 42.
    bool test_aligned_size_const_preserves_originals(void) {
        WriteFmt("Testing front insert preserves originals (aligned_size assign)\n");
    
        U64Vec vec = VecInit(&alloc);
    // 238:20  cxx_replace_scalar_call : replaces vec_aligned_size() with a scalar.
    bool test_aligned_size_call_preserves_originals(void) {
        WriteFmt("Testing front insert keeps first original (aligned_size call)\n");
    
        U64Vec vec = VecInit(&alloc);
    // 249:26  cxx_sub_to_add : shift-right size `(length - idx)` -> `(length + idx)`.
    bool test_shift_right_size_middle_insert(void) {
        WriteFmt("Testing middle insert shift-right size\n");
    
        // Large N so that the `(length + idx)` over-copy of the mutant overruns the
    // 221:10  cxx_init_const : `inserted_count = 0` -> 42.
    bool test_rollback_first_item_no_deinit(void) {
        WriteFmt("Testing rollback on first-item failure deinit's nothing\n");
    
        int      tags[] = {1, 2, 3};
    // 257:27  cxx_init_const : rollback loop start `size s = 0` -> 42.
    bool test_rollback_loop_start_index(void) {
        WriteFmt("Testing rollback loop start index deinit's all inited items\n");
    
        int      tags[] = {1, 2, 3};
    // 257:36  cxx_lt_to_ge : rollback condition `s < inserted_count` -> `s >= ...`.
    bool test_rollback_cond_runs_for_inited(void) {
        WriteFmt("Testing rollback condition deinit's the single inited item\n");
    
        int      tags[] = {1, 2, 3};
    // 257:36  cxx_lt_to_le : rollback condition `s < inserted_count` -> `s <= ...`.
    bool test_rollback_cond_skips_failed_slot(void) {
        WriteFmt("Testing rollback never deinit's the failed slot\n");
    
        int      tags[] = {1, 2, 3};
    // 257:55  cxx_post_inc_to_post_dec : rollback step `s++` -> `s--`.
    bool test_rollback_step_increments(void) {
        WriteFmt("Testing rollback step deinit's every inited item\n");
    
        int      tags[] = {1, 2, 3};
    // 258:58  cxx_add_to_sub : rollback deinit target `idx + s` -> `idx - s`.
    bool test_rollback_deinit_target_slots(void) {
        WriteFmt("Testing rollback deinit targets the inserted slots\n");
    
        int      tags[] = {1}; // single existing element 'A' at slot 0
    // 273:27  cxx_post_inc_to_post_dec : `inserted_count++` -> `inserted_count--`.
    bool test_rollback_inserted_count_step(void) {
        WriteFmt("Testing inserted_count increment bounds the rollback loop\n");
    
        int      tags[] = {1, 2, 3};
    // 262:25  cxx_lt_to_ge : shift-back guard `idx < length` -> `idx >= length`.
    bool test_rollback_restore_middle_guard(void) {
        WriteFmt("Testing failed middle insert restores originals (shift-back guard)\n");
    
        int      tags[] = {1, 2, 3}; // A,B,C
    // 265:45  cxx_add_to_sub : shift-back source `idx + count` -> `idx - count`.
    bool test_rollback_restore_shiftback_source(void) {
        WriteFmt("Testing failed middle insert restores from correct source\n");
    
        int      tags[] = {1, 2, 3};
    // 266:38  cxx_sub_to_add : shift-back size `(length - idx)` -> `(length + idx)`.
    bool test_rollback_restore_shiftback_size_sub(void) {
        WriteFmt("Testing failed insert shift-back size (sub)\n");
    
        // Large N: the `(length + idx)` over-move of the mutant runs ~length
    // `(length - idx) / aligned`.
    bool test_rollback_restore_shiftback_size_div(void) {
        WriteFmt("Testing failed middle insert shift-back size (div)\n");
    
        int      tags[] = {1, 2, 3};
    // vec_insert_range_l, preserve-order path.
    bool test_insert_range_l_preserve_inserts_all(void) {
        WriteFmt("Testing VecInsertRangeL (preserve order) inserts all items\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // vec_insert_range_l, fast (non-preserve) path.
    bool test_insert_range_l_fast_inserts_all(void) {
        WriteFmt("Testing VecInsertRangeFastL inserts all items\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // vec_insert_one_l.
    bool test_insert_one_l_inserts_value(void) {
        WriteFmt("Testing VecInsertL inserts a single value\n");
    
        DefaultAllocator local = DefaultAllocatorInit();
    // is false.
    bool test_insert_range_fast_l_reports_failure(void) {
        WriteFmt("Testing VecInsertRangeFastL reports copy_init failure (603:32)\n");
    
        // Canary allocator: the empty-vec / idx==length failure path also pins the
    // copy_init fails and assert the return is false with nothing landed.
    bool test_insert_one_l_reports_failure(void) {
        WriteFmt("Testing VecInsertL reports copy_init failure (584:10)\n");
    
        MutElemVec vec = VecInitWithDeepCopy(mut_copy_init, mut_copy_deinit, &alloc);
    // slots sit one-past-end and are observable.
    bool test_insert_fail_tail_zeroed(void) {
        WriteFmt("Testing insert failure zeroes vacated tail slots\n");
    
        ElemVec vec = VecInitWithDeepCopy(elem_copy_init, elem_copy_deinit, &alloc);
    // count >= 2) leaves the stale parked copies. Observable one-past-end.
    bool test_fast_insert_fail_tail_zeroed(void) {
        WriteFmt("Testing fast-insert failure zeroes parked tail slots\n");
    
        ElemVec vec = VecInitWithDeepCopy(elem_copy_init, elem_copy_deinit, &alloc);
    int main(void) {
        alloc = DefaultAllocatorInit();
        WriteFmt("[INFO] Starting Vec.Insert tests\n\n");
    
        // Array of test functions
    // Test basic Vec type functionality
    bool test_vec_type_basic(void) {
        WriteFmt("Testing basic Vec type functionality\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test ValidateVec macro
    bool test_vec_validate(void) {
        WriteFmt("Testing ValidateVec macro\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Vec.Type tests\n\n");
    
        // Array of test functions
    
        // Print before state
        WriteFmt("Before fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("Before fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Test VecDeleteRangeFast - delete 3 elements starting at index 2
    
        // Print after state
        WriteFmt("After fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("After fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Check length after deletion
    
        // Print before state
        WriteFmt("Before L-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("Before L-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Test L-value fast delete operation
    
        // Print after state
        WriteFmt("After L-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("After L-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Check vector after L-value fast deletion
    
        // Print before state
        WriteFmt("Before R-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("Before R-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Remember the value to be deleted and the last value
    
        // Print after state
        WriteFmt("After R-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("After R-value fast delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Check length
    
        // Print before state
        WriteFmt("Before L-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("Before L-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Values that should be deleted (30, 40, 50)
    
        // Print after state
        WriteFmt("After L-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("After L-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Check vector after L-value fast range deletion
    
        // Print before state
        WriteFmt("Before R-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("Before R-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Values that should be deleted (30, 40, 50)
    
        // Print after state
        WriteFmt("After R-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        WriteFmt("After R-value fast range delete: ");
        for (u64 i = 0; i < VecLen(&vec); i++) {
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
            WriteFmt("{} ", VecAt(&vec, i));
        }
        WriteFmt("\n");
    
        // Check vector after R-value fast range deletion
    // runs, so removed elements are dropped without releasing their resources.
    bool test_remove_deinit_init_zero(void) {
        WriteFmt("Testing remove copy_deinit loop starts at zero\n");
    
        reset_ledger();
    // body never runs.
    bool test_remove_deinit_runs_at_all(void) {
        WriteFmt("Testing remove copy_deinit loop runs\n");
    
        reset_ledger();
    // deinitializes a SURVIVING element.
    bool test_remove_deinit_no_overrun(void) {
        WriteFmt("Testing remove copy_deinit does not overrun window\n");
    
        reset_ledger();
    // 380:42 cxx_post_inc_to_post_dec (`s++` -> `s--`).
    bool test_remove_deinit_all_three(void) {
        WriteFmt("Testing remove copy_deinit covers every removed element\n");
    
        reset_ledger();
    // 382:29 cxx_replace_scalar_call (cursor stride replaced by constant 0).
    bool test_remove_deinit_advances_cursor(void) {
        WriteFmt("Testing remove copy_deinit advances per element\n");
    
        reset_ledger();
    // 395:22 cxx_sub_to_add (`length - start - count` -> `length + start - count`).
    bool test_remove_compaction_len_first_term(void) {
        WriteFmt("Testing remove compaction length (first term, large start)\n");
    
        typedef Vec(int) IntVec;
    // 395:30 cxx_sub_to_add (`length - start - count` -> `length - start + count`).
    bool test_remove_compaction_len_second_term(void) {
        WriteFmt("Testing remove compaction length (second term, large count)\n");
    
        typedef Vec(int) IntVec;
    // 395:41 cxx_replace_scalar_call (compaction MemMove stride replaced by 42).
    bool test_remove_compaction_stride(void) {
        WriteFmt("Testing remove compaction stride (large over-move)\n");
    
        typedef Vec(int) IntVec;
    // 397:41 cxx_sub_to_add (tail-clear `vec->length - count` -> `length + count`).
    bool test_remove_tail_clear_dest(void) {
        WriteFmt("Testing remove tail-clear destination\n");
    
        typedef Vec(int) IntVec;
    // 397:72 cxx_mul_to_div (`count * stride` -> `count / stride`).
    bool test_remove_tail_clear_len(void) {
        WriteFmt("Testing remove tail-clear length\n");
    
        typedef Vec(int) IntVec;
    // 397:74 cxx_replace_scalar_call (tail-clear stride replaced by constant 42).
    bool test_remove_tail_clear_stride(void) {
        WriteFmt("Testing remove tail-clear stride (large over-write)\n");
    
        typedef Vec(int) IntVec;
    // over-copy test relies on. Real code moves 0 bytes and returns cleanly.
    bool test_remove_compaction_size_first_term(void) {
        WriteFmt("Testing remove compaction size (length - start term)\n");
    
        typedef Vec(u64) U64Vec;
    // tail element and compacts correctly.
    bool test_remove_compaction_size_second_term(void) {
        WriteFmt("Testing remove compaction size (- count term)\n");
    
        typedef Vec(u64) U64Vec;
    
    bool test_vec_foreach(void) {
        WriteFmt("Testing VecForeach\n");
    
        // Create a vector of integers
    // Test VecForeachIdx macro
    bool test_vec_foreach_idx(void) {
        WriteFmt("Testing VecForeachIdx\n");
    
        // Create a vector of integers
    // Test VecForeachPtr macro
    bool test_vec_foreach_ptr(void) {
        WriteFmt("Testing VecForeachPtr\n");
    
        // Create a vector of integers
    // Test VecForeachPtrIdx macro
    bool test_vec_foreach_ptr_idx(void) {
        WriteFmt("Testing VecForeachPtrIdx\n");
    
        // Create a vector of integers
    // Test VecForeachReverse macro
    bool test_vec_foreach_reverse(void) {
        WriteFmt("Testing VecForeachReverse\n");
    
        // Create a vector of integers
    // Test VecForeachReverseIdx macro
    bool test_vec_foreach_reverse_idx(void) {
        WriteFmt("Testing VecForeachReverseIdx\n");
    
        // Create a vector of integers
    // Test VecForeachPtrReverse macro
    bool test_vec_foreach_ptr_reverse(void) {
        WriteFmt("Testing VecForeachPtrReverse\n");
    
        // Create a vector of integers
    // Test VecForeachPtrReverseIdx macro
    bool test_vec_foreach_ptr_reverse_idx(void) {
        WriteFmt("Testing VecForeachPtrReverseIdx\n");
    
        // Create a vector of integers
    // Make idx go out of bounds during VecForeach by modifying vector during iteration
    bool test_vec_foreach_out_of_bounds_access(void) {
        WriteFmt("Testing VecForeach where modification causes out of bounds access (should crash)\n");
    
        typedef Vec(int) IntVec;
        int iteration_count = 0;
        VecForeach(&vec, val) {
            WriteFmt("Iteration {} (vec.length={}): {}\n", iteration_count, VecLen(&vec), val);
    
            // After 2nd iteration, shrink the vector dramatically
            if (iteration_count == 2) {
                VecResize(&vec, 2); // Shrink to only 2 elements
                WriteFmt("Vector resized to length {} during foreach iteration...\n", VecLen(&vec));
            }
    // Make idx go out of bounds in VecForeachIdx by modifying vector during iteration
    bool test_vec_foreach_idx_out_of_bounds_access(void) {
        WriteFmt("Testing VecForeachIdx where idx goes out of bounds (should crash)\n");
    
        typedef Vec(int) IntVec;
        // VecForeachIdx has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        VecForeachIdx(&vec, val, idx) {
            WriteFmt("Accessing idx {} (vec.length={}): {}\n", idx, VecLen(&vec), val);
    
            // When we reach idx=2, drastically shrink the vector to make the current idx invalid
            if (idx == 2) {
                VecResize(&vec, 2); // Shrink so that idx=2 becomes out of bounds (valid indices: 0,1)
                WriteFmt("Vector resized to length {}, current idx={} is now out of bounds...\n", VecLen(&vec), idx);
            }
    // Make idx go out of bounds in VecForeachReverseIdx by modifying vector during iteration
    bool test_vec_foreach_reverse_idx_out_of_bounds_access(void) {
        WriteFmt("Testing VecForeachReverseIdx where idx goes out of bounds (should crash)\n");
    
        typedef Vec(int) IntVec;
        // VecForeachReverseIdx has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        VecForeachReverseIdx(&vec, val, idx) {
            WriteFmt("Accessing idx {} (vec.length={}): {}\n", idx, VecLen(&vec), val);
    
            // When we reach idx=4, drastically shrink the vector
            if (idx == 4) {
                VecResize(&vec, 2); // Shrink to only 2 elements
                WriteFmt("Vector resized to length {} during reverse iteration...\n", VecLen(&vec));
            }
    // Make idx go out of bounds in VecForeachPtrIdx by modifying vector during iteration
    bool test_vec_foreach_ptr_idx_out_of_bounds_access(void) {
        WriteFmt("Testing VecForeachPtrIdx where idx goes out of bounds (should crash)\n");
    
        typedef Vec(int) IntVec;
        // VecForeachPtrIdx has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        VecForeachPtrIdx(&vec, val_ptr, idx) {
            WriteFmt("Accessing idx {} (vec.length={}): {}\n", idx, VecLen(&vec), *val_ptr);
    
            // When we reach idx=3, shrink the vector to make the CURRENT idx invalid
            if (idx == 3) {
                VecResize(&vec, 3); // Shrink so that idx=3 becomes out of bounds (valid indices: 0,1,2)
                WriteFmt("Vector resized to length {}, current idx={} is now out of bounds...\n", VecLen(&vec), idx);
            }
    // Make idx go out of bounds in VecForeachPtrReverseIdx by modifying vector during iteration
    bool test_vec_foreach_ptr_reverse_idx_out_of_bounds_access(void) {
        WriteFmt("Testing VecForeachPtrReverseIdx where idx goes out of bounds (should crash)\n");
    
        typedef Vec(int) IntVec;
        // VecForeachPtrReverseIdx has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        VecForeachPtrReverseIdx(&vec, val_ptr, idx) {
            WriteFmt("Accessing idx {} (vec.length={}): {}\n", idx, VecLen(&vec), *val_ptr);
    
            // When we reach idx=5, shrink the vector significantly
            if (idx == 5) {
                VecResize(&vec, 3); // Shrink to only 3 elements
                WriteFmt("Vector resized to length {} during reverse ptr iteration...\n", VecLen(&vec));
            }
    // Make idx go out of bounds in VecForeachPtrInRangeIdx by modifying vector during iteration
    bool test_vec_foreach_ptr_in_range_idx_out_of_bounds_access(void) {
        WriteFmt("Testing VecForeachPtrInRangeIdx where idx goes out of bounds (should crash)\n");
    
        typedef Vec(int) IntVec;
        size original_length = VecLen(&vec); // Capture this as 9
        VecForeachPtrInRangeIdx(&vec, val_ptr, idx, 0, original_length) {
            WriteFmt("Accessing idx {} (vec.length={}): {}\n", idx, VecLen(&vec), *val_ptr);
    
            // When we reach idx=3, delete several elements
            if (idx == 3) {
                VecDeleteRange(&vec, 0, 6); // Remove first 6 elements
                WriteFmt("Deleted first 6 elements, new length={}, idx = {}\n", VecLen(&vec), original_length, idx);
            }
    // Make idx go out of bounds in basic VecForeachIdx by modifying vector during iteration
    bool test_vec_foreach_idx_basic_out_of_bounds_access(void) {
        WriteFmt("Testing basic VecForeachIdx where idx goes out of bounds (should crash)\n");
    
        typedef Vec(int) IntVec;
        // Basic VecForeachIdx now has explicit bounds checking: if ((idx) >= (v)->length) LOG_FATAL(...)
        VecForeachIdx(&vec, val, idx) {
            WriteFmt("Accessing idx {} (vec.length={}): {}\n", idx, VecLen(&vec), val);
    
            // When we reach idx=2, drastically shrink the vector
            if (idx == 2) {
                VecResize(&vec, 1); // Shrink to only 1 element
                WriteFmt("Vector resized to length {}, current index={}\n", VecLen(&vec), idx);
            }
    int main(void) {
        alloc = DefaultAllocatorInit();
        WriteFmt("[INFO] Starting Vec.Foreach.Simple tests\n\n");
    
        // Array of normal test functions
    // Test VecAt function
    bool test_vec_at(void) {
        WriteFmt("Testing VecAt\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecPtrAt function
    bool test_vec_ptr_at(void) {
        WriteFmt("Testing VecPtrAt\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecFirst and VecLast functions
    bool test_vec_first_last(void) {
        WriteFmt("Testing VecFirst and VecLast\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecBegin and VecEnd functions
    bool test_vec_begin_end(void) {
        WriteFmt("Testing VecBegin and VecEnd\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test VecSize and VecLen functions
    bool test_vec_size_len(void) {
        WriteFmt("Testing VecSize and VecLen\n");
    
        DefaultAllocator alloc    = DefaultAllocatorInit();
    // Test VecAlignedOffsetAt function
    bool test_vec_aligned_offset_at(void) {
        WriteFmt("Testing VecAlignedOffsetAt\n");
    
        DefaultAllocator alloc    = DefaultAllocatorInit();
    // Test VecEmpty, VecFind, and VecContains functions
    bool test_vec_empty_find_contains(void) {
        WriteFmt("Testing VecEmpty, VecFind, and VecContains\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // `sizeof(u32)`, so they cannot diverge.
    bool test_aligned_stride_roundtrip(void) {
        WriteFmt("Testing element stride round-trips values\n");
    
        HeapAllocator alloc = HeapAllocatorInitAligned(16);
    // clone of distinct values produces duplicated/incorrect data.
    bool test_clone_reads_distinct_offsets(void) {
        WriteFmt("Testing clone reads each source element at its own offset\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting Vec.Access tests\n\n");
    
        // Array of test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecShrinkToFit\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReserve\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSwap\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecClone\n");
    
        BitVec original = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_clone_inherits_allocator_config(void) {
        WriteFmt("Testing BitVecClone allocator inheritance\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecShrinkToFit edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReserve edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSwap edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecClone edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec memory stress test\n");
    
        bool result = true;
    // Deadend tests
    bool test_bitvec_memory_null_failures(void) {
        WriteFmt("Testing BitVec memory NULL pointer handling\n");
    
        // Test NULL bitvec pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec swap NULL handling\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_clone_null_failures(void) {
        WriteFmt("Testing BitVec clone NULL handling\n");
    
        // Test NULL pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing resize-grow clears stale tail bits\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReserve with zero capacity returns true\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    // Kills: 107:5 remove_void_call (ValidateBitVec dropped).
    bool test_resize_null_aborts(void) {
        WriteFmt("Testing BitVecResize NULL handle aborts\n");
    
        BitVecResize(NULL, 5);
    // Kills: 139:5 remove_void_call (ValidateBitVec dropped).
    bool test_reserve_null_aborts(void) {
        WriteFmt("Testing BitVecReserve NULL handle aborts\n");
    
        BitVecReserve(NULL, 5);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecShrinkToFit preserves bits on a large vector\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecShrinkToFit keeps the vector structurally valid\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSwap keeps a swapped-in large vector valid\n");
    
        BitVec small = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSwap aborts on an invalid second argument\n");
    
        BitVec good = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecTryClone aborts on an invalid source\n");
    
        BitVec out = BitVecInit(ALLOCATOR_OF(&alloc));
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Memory tests\n\n");
    
        // Array of normal test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInit\n");
    
        // Test basic initialization
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecDeinit\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReserve\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecClear\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecResize\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInit edge cases\n");
    
        // Test multiple initializations
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReserve edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReu64 edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecClear edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec multiple init/deinit cycles\n");
    
        bool result = true;
    // Deadend tests - verify expected failures occur gracefully
    bool test_bitvec_null_pointer_failures(void) {
        WriteFmt("Testing BitVec NULL pointer handling\n");
    
        // Test NULL pointer passed to functions that should validate
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec invalid operations\n");
    
        // BitVecReserve is now a fallible API that returns bool on allocation
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec set operations on invalid indices\n");
    
        // BitVecResize is now a fallible API that returns bool on allocation
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Init tests\n\n");
    
        // Array of normal test functions
    // Deadend tests - testing NULL pointers and invalid conditions that should cause fatal errors
    bool test_bitvec_find_deadend_tests(void) {
        WriteFmt("Testing BitVecFind deadend scenarios\n");
    
        // This should cause LOG_FATAL and terminate the program
    
    bool test_bitvec_predicate_deadend_tests(void) {
        WriteFmt("Testing BitVec predicate deadend scenarios\n");
    
        // This should cause LOG_FATAL and terminate the program
    
    bool test_bitvec_longest_run_deadend_tests(void) {
        WriteFmt("Testing BitVecLongestRun deadend scenarios\n");
    
        // This should cause LOG_FATAL and terminate the program
    // Deadend tests
    bool test_bitvec_access_null_failures(void) {
        WriteFmt("Testing BitVec access NULL pointer handling\n");
    
        // Test NULL bitvec pointer - should abort
    
    bool test_bitvec_set_null_failures(void) {
        WriteFmt("Testing BitVec set NULL pointer handling\n");
    
        // Test NULL bitvec pointer - should abort
    
    bool test_bitvec_flip_null_failures(void) {
        WriteFmt("Testing BitVec flip NULL pointer handling\n");
    
        // Test NULL bitvec pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec get bounds checking\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec set bounds checking\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec flip bounds checking\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec get with large out-of-bounds index\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec set with large out-of-bounds index\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec flip with edge case out-of-bounds index\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_count_null_failures(void) {
        WriteFmt("Testing BitVec count operations with NULL pointer\n");
    
        // Test NULL bitvec pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec get with maximum index value\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    // Main function that runs all deadend tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Access.Deadend tests\n\n");
    
        // Deadend tests that would cause program termination
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEquals\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCompare\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecLexCompare\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecNumericalCompare\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecWeightCompare\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecIsSubset\n");
    
        BitVec subset   = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSignedCompare\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecIsSuperset\n");
    
        BitVec superset = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecOverlaps\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecDisjoint and BitVecIntersects\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEqualsRange\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCompareRange\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecIsLexicographicallyLess and BitVecIsNumericallyLess\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecIsSorted\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec compare edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec set operations edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec comprehensive comparison operations\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec large-scale comparison operations\n");
    
        BitVec large1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec compare NULL pointer handling\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_subset_null_failures(void) {
        WriteFmt("Testing BitVec subset NULL handling\n");
    
        // Test NULL pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec range operations NULL handling\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec range operations bounds checking\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_sorted_null_failures(void) {
        WriteFmt("Testing BitVec sorted operations NULL handling\n");
    
        // Test NULL pointer - should abort
    // Two bitvectors built the same way must hash identically.
    bool test_bitvec_hash_determinism(void) {
        WriteFmt("Testing bitvec_hash determinism\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // share a byte prefix but differ in length must still distinguish.
    bool test_bitvec_hash_distinguishes(void) {
        WriteFmt("Testing bitvec_hash sensitivity to bits and length\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // shaped helpers wired in directly -- no per-callsite cast needed.
    bool test_bitvec_hash_as_map_key(void) {
        WriteFmt("Testing bitvec_hash as Map<BitVec, u64> key\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // equality / identity. Mirrors how str_compare is exercised.
    bool test_bitvec_compare_callback(void) {
        WriteFmt("Testing bitvec_compare as GenericCompare callback\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEquals rejects bad second operand\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEqualsRange rejects bad second operand\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecIsSubset scans past index 42\n");
    
        BitVec bv1 = BitVecInit(base);
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecIsSubset with shorter bv1 stays in bounds\n");
    
        BitVec bv1 = BitVecInit(base); // length 2
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecIsSubset with shorter bv2 stays in bounds\n");
    
        BitVec bv1 = BitVecInit(base); // length 5
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecDisjoint scans beyond position 0\n");
    
        BitVec bv1 = BitVecInit(base);
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecIsSubset rejects NULL bv2\n");
    
        BitVec bv1 = BitVecInit(base);
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecDisjoint rejects NULL bv1\n");
    
        BitVec bv2 = BitVecInit(base);
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecDisjoint rejects NULL bv2\n");
    
        BitVec bv1 = BitVecInit(base);
    
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Compare tests\n\n");
    
        // Array of normal test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecPush\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsert (single bit)\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertRange\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertMultiple\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertPattern\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertRange edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertMultiple edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertPattern edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
    // Deadend tests
    bool test_bitvec_insert_null_failures(void) {
        WriteFmt("Testing BitVec insert NULL pointer handling\n");
    
        // Test NULL bitvec pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec insert invalid range handling\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_insert_pattern_null_failures(void) {
        WriteFmt("Testing BitVec insert pattern NULL handling\n");
    
        // Test NULL bitvec - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertRange shifts existing tail bits\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertMultiple shifts existing tail bits\n");
    
        BitVec bv    = BitVecInit(ALLOCATOR_OF(&alloc));
    // With validation removed, a NULL bitvec is accepted instead of aborting.
    bool test_insert_null_aborts(void) {
        WriteFmt("Testing BitVecInsert NULL validation\n");
    
        BitVecInsert(NULL, 0, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertMultiple NULL bv validation\n");
    
        BitVec other = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecInsertMultiple NULL other validation\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Insert tests\n\n");
    
        // Array of normal test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindPattern(NULL, pattern) - should fatal\n");
    
        BitVec pattern = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindPattern(source, NULL) - should fatal\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindLastPattern(NULL, pattern) - should fatal\n");
    
        BitVec pattern = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindLastPattern(source, NULL) - should fatal\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
    // Deadend test 5: BitVecFindAllPattern with NULL source
    bool test_bitvec_find_all_pattern_null_source(void) {
        WriteFmt("Testing BitVecFindAllPattern(NULL, pattern, results, 10) - should fatal\n");
    
        size results[10];
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindAllPattern(source, NULL, results, 10) - should fatal\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindAllPattern(source, pattern, NULL, 10) - should fatal\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindAllPattern(source, pattern, results, 0) - should fatal\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecStartsWith(NULL, prefix) - should fatal\n");
        BitVec prefix = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&prefix, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecStartsWith(source, NULL) - should fatal\n");
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&source, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEndsWith(NULL, suffix) - should fatal\n");
        BitVec suffix = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&suffix, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEndsWith(source, NULL) - should fatal\n");
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&source, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecContainsAt(NULL, pattern, 0) - should fatal\n");
        BitVec pattern = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&pattern, true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecContainsAt(source, NULL, 0) - should fatal\n");
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&source, true);
    
    bool test_bitvec_replace_null_source(void) {
        WriteFmt("Testing BitVecReplace(NULL, old, new) - should fatal\n");
    
        // Don't create BitVecs since we're testing NULL source validation
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecMatches(NULL, pattern, wildcard) - should fatal\n");
        BitVec pattern  = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVec wildcard = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_regex_match_null_source(void) {
        WriteFmt("Testing BitVecRegexMatch(NULL, pattern) - should fatal\n");
        BitVecRegexMatch(NULL, "101");
        return true;
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRegexMatch(source, NULL) - should fatal\n");
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&source, true);
    bool test_bitvec_prefix_match_null_source(void) {
        DefaultAllocator alloc = DefaultAllocatorInit();
        WriteFmt("Testing BitVecPrefixMatch(NULL, patterns, 1) - should fatal\n");
        BitVecs vp = VecInitWithDeepCopy(NULL, BitVecDeinit, ALLOCATOR_OF(&alloc));
        BitVecPush(VecPtrAt(&vp, 0), true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecPrefixMatch(source, NULL, 1) - should fatal\n");
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&source, true);
    bool test_bitvec_suffix_match_null_source(void) {
        DefaultAllocator alloc = DefaultAllocatorInit();
        WriteFmt("Testing BitVecSuffixMatch(NULL, patterns, 1) - should fatal\n");
        BitVecs vp = VecInitWithDeepCopy(NULL, BitVecDeinit, ALLOCATOR_OF(&alloc));
        BitVecPush(VecPtrAt(&vp, 0), true);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSuffixMatch(source, NULL, 1) - should fatal\n");
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        BitVecPush(&source, true);
    // would let the NULL flow into `bv->length` instead.
    bool test_find_last_null_bv_aborts(void) {
        WriteFmt("Testing BitVecFindLast with NULL bitvector\n");
        BitVecFindLast(NULL, true);
        return true; // Should never reach here.
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecFindAllPattern (vec) with NULL bitvector\n");
    
        BitVec pattern = BitVecInit(base);
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecFindAllPattern (vec) with NULL pattern\n");
    
        BitVec source = BitVecInit(base);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplace(src, old, NULL) with old absent - should fatal\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplaceAll(uninitialized, old, new) - should fatal\n");
    
        BitVec bad         = {0}; // magic mismatch -> ValidateBitVec aborts
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplaceAll(empty, NULL, new) - should fatal\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc)); // empty
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplaceAll(empty, old, NULL) - should fatal\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc)); // empty
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecPrefixMatch(NULL, empty) - should fatal\n");
    
        BitVecs patterns = VecInitWithDeepCopy(NULL, BitVecDeinit, ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSuffixMatch(NULL, empty) - should fatal\n");
    
        BitVecs patterns = VecInitWithDeepCopy(NULL, BitVecDeinit, ALLOCATOR_OF(&alloc));
    // Main function that runs all deadend tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Pattern.Deadend tests\n\n");
    
        // Deadend tests that would cause program termination
    
    bool test_bitvec_run_lengths_null_bv(void) {
        WriteFmt("Testing BitVecRunLengths with NULL bitvector\n");
    
        u64  runs[5];
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths with NULL runs array\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths with NULL values array\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths with zero max_runs\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec foreach with invalid bitvec\n");
    
        // Test foreach with invalid bitvec (length > 0 but data is NULL)
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecRunLengths (vec) with NULL bitvector\n");
    
        BitVecRuns runs = VecInitT(runs, base);
    // Main function that runs all deadend tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Foreach.Deadend tests\n\n");
    
        // Array of deadend test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecForeachIdx macro\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecForeach macro\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecForeachReverseIdx macro\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecForeachReverse macro\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecForeachInRangeIdx macro\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecForeachInRange macro\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec foreach edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec foreach idx edge cases\n");
    
        BitVec bv       = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec foreach reverse edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec foreach range edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec foreach stress test\n");
    
        bool result = true;
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths basic functionality\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecRunLengths Vec form\n");
    
        BitVec bv = BitVecInit(base);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths edge cases\n");
    
        bool result = true;
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths boundary conditions\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRunLengths stress test\n");
    
        bool result = true;
    // Main function that runs all simple tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Foreach.Simple tests\n\n");
    
        // Array of normal test functions
    // Test basic BitVec type functionality
    bool test_bitvec_type_basic(void) {
        WriteFmt("Testing basic BitVec type functionality\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // Test ValidateBitVec macro
    bool test_bitvec_validate(void) {
        WriteFmt("Testing ValidateBitVec macro\n");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    // real code and dies (longjmp) under the mutant.
    bool test_validate_memoization_skips_structural(void) {
        WriteFmt("Testing ValidateBitVec honours the validated-bit memoization (1943:23)\n");
    
        BitVec bv = {0};
    // mutant skips it and returns. Deadend => expects the abort.
    bool test_structural_byte_size_check_aborts(void) {
        WriteFmt("Testing validate_bitvec_structural catches an undersized byte_size (1926:22)\n");
    
        BitVec bv    = {0};
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Type tests\n\n");
    
        // Array of test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecAnd\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecOr\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecXor\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecNot\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecShiftLeft\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecShiftRight\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRotateLeft\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRotateRight\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReverse\n");
    
        BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec shift edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec rotate edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec bitwise operations edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReverse edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec comprehensive bitwise operations\n");
    
        BitVec bv1         = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec comprehensive shift operations\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec comprehensive rotate operations\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec bitwise identity operations\n");
    
        BitVec bv1         = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec bitwise commutative properties\n");
    
        BitVec bv1         = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec bitwise operations with large patterns\n");
    
        BitVec bv1         = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecOr widens past shorter operand a\n");
    
        BitVec a      = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecXor widens past shorter operand a\n");
    
        BitVec a      = BitVecInit(ALLOCATOR_OF(&alloc));
    bool test_rotate_right_frees_temp_clone(void);
    bool test_rotate_right_frees_temp_clone(void) {
        WriteFmt("Testing BitVecRotateRight frees its temp clone (1157:5)\n");
    
        DebugAllocator dbg  = DebugAllocatorInit();
    bool test_rotate_left_frees_temp_clone(void);
    bool test_rotate_left_frees_temp_clone(void) {
        WriteFmt("Testing BitVecRotateLeft frees its temp clone (1131:5)\n");
    
        DebugAllocator dbg  = DebugAllocatorInitWith(lean_dbg_cfg());
    // Main function that runs all tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.BitWise tests\n\n");
    
        // Array of normal test functions
    // Deadend tests
    bool test_bitvec_bitwise_null_failures(void) {
        WriteFmt("Testing BitVec bitwise NULL pointer handling\n");
    
        // Test NULL bitvec pointer - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec bitwise operations NULL handling\n");
    
        BitVec bv  = BitVecInit(ALLOCATOR_OF(&alloc));
    
    bool test_bitvec_reverse_null_failures(void) {
        WriteFmt("Testing BitVec reverse NULL handling\n");
    
        // Test NULL pointer - should abort
    // NEW: Additional deadend tests
    bool test_bitvec_shift_ops_null_failures(void) {
        WriteFmt("Testing BitVec shift operations NULL handling\n");
    
        // Test NULL pointer for shift right - should abort
    
    bool test_bitvec_rotate_ops_null_failures(void) {
        WriteFmt("Testing BitVec rotate operations NULL handling\n");
    
        // Test NULL pointer for rotate - should abort
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec AND with NULL result handling\n");
    
        BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec OR with NULL operand handling\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec XOR with NULL second operand handling\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec NOT with NULL handling\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecAnd rejects bad third operand\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecAnd rejects bad second operand\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecOr rejects bad second operand\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecXor rejects bad third operand\n");
    
        BitVec result = BitVecInit(ALLOCATOR_OF(&alloc));
    // Main function that runs all deadend tests
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.BitWise.Deadend tests\n\n");
    
        // Array of deadend test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing basic BitVec pattern functions\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindPattern function\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindLastPattern function\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindAllPattern function\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        Allocator       *base  = ALLOCATOR_OF(&alloc);
    
        WriteFmt("Testing BitVecFindAllPattern Vec form\n");
    
        BitVec source  = BitVecInit(base);
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec pattern edge cases\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec pattern stress tests\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecStartsWith basic functionality\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecStartsWith edge cases\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEndsWith basic functionality\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEndsWith edge cases\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFindPattern basic functionality\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecContainsAt basic functionality\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecContainsAt edge cases\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCountPattern basic functionality\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRFindPattern basic functionality\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplace basic functionality\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplaceAll basic functionality\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecMatches basic functionality\n");
    
        BitVec source   = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecFuzzyMatch basic functionality\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRegexMatch basic functionality\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecPrefixMatch basic functionality\n");
    
        BitVec  source   = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecSuffixMatch basic functionality\n");
    
        BitVec  source   = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRFindPattern window-condition (ge_to_lt)\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRFindPattern window-condition (add_to_sub)\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRFindPattern window-value (add_to_sub)\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRFindPattern loop-seed (add_to_sub)\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecRFindPattern loop-guard (gt_to_ge)\n");
    
        BitVec source  = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplaceAll found-flag init\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecReplaceAll forward-scan direction\n");
    
        BitVec source      = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing bitvec_regex_match_str returns false on non-match\n");
    
        BitVec source = BitVecInit(ALLOCATOR_OF(&alloc));
    bool test_regex_match_zstr_frees_rendered_str(void);
    bool test_regex_match_zstr_frees_rendered_str(void) {
        WriteFmt("Testing bitvec_regex_match_zstr frees its rendered Str (1866:5)\n");
    
        DebugAllocator dbg  = DebugAllocatorInitWith(lean_dbg_cfg());
    bool test_regex_match_str_frees_rendered_str(void);
    bool test_regex_match_str_frees_rendered_str(void) {
        WriteFmt("Testing bitvec_regex_match_str frees its rendered Str (1883:5)\n");
    
        DebugAllocator dbg  = DebugAllocatorInitWith(lean_dbg_cfg());
    
    int main(void) {
        WriteFmt("[INFO] Starting BitVec.Pattern.Simple tests\n\n");
    
        // Array of test functions
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecHammingDistance basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecHammingDistance edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecJaccardSimilarity basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecJaccardSimilarity edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCosineSimilarity basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCosineSimilarity edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecDotProduct basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecDotProduct edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEditDistance basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEditDistance edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCorrelation basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecCorrelation edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEntropy basic functionality\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecEntropy edge cases\n");
    
        BitVec bv     = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecAlignmentScore basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecAlignmentScore edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecBestAlignment basic functionality\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVecBestAlignment edge cases\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        WriteFmt("Testing BitVec Math stress tests\n");
    
        BitVec bv1    = BitVecInit(ALLOCATOR_OF(&alloc));