remedy-lua 0.1.2

A Lua 5.4 superset in safe Rust for running untrusted scripts: exact fuel, memory and depth limits, an incremental collector, an optional typed dialect and a capability-based host API.
Documentation
# Which tests depend on time, for tools/gate.sh and the guard test
# `test_lists::timing_list_matches_the_tests`. One name per line, `module::fn` as
# `cargo test --test all -- --list` prints it. See docs/testing.md.
#
# [timing]  pass or fail can depend on measured CPU or wall time. The gate runs them
#           serially on a quiet machine (step T); every other step skips them.
# [env]     the subset of [timing] that follows REMEDYLUA_TEST_NO_FAST_LOOP for some state
#           it measures (the rest set the loop on each state, or never run the
#           interpreter). Run a second time with the variable set (step Tn).
# [oracle]  the tests only `--features front-oracle` adds or changes (step O).
# [clock-deterministic]  reads a clock (often a fake or counting one) but asserts counts,
#           fuel or results.
# [hang-guard]  fails on time only past a generous 8-60 s bound (a watchdog, the fuzz
#           harness's 10 s C Lua wall and 60 s timeout).
# [time-capped]  time can only end a loop early, under an env cap (REMEDYLUA_SOAK_SECS,
#           REMEDYLUA_S3_SECS, SWEEP*_SECS); without one the loop counts iterations.
# [probe]   ignored exploration helpers that time something and assert nothing on it.
#           These four classes run in the parallel steps.
# [known]   `module::fn FINDING`: a test tied to a finding still open in docs/known-issues.md (gate
#           rule 5). Its step runs it and reports its result, but a failure of it alone
#           does not fail the step. Remove the entry in the commit that closes the
#           finding; the guard fails while it names a finding that is not open.
#           Any test the guard finds reading a clock must be in one of these sections:
#           a direct `thread_cpu(`, `Instant::now`, `.elapsed(`, `set_time_limit(` or
#           `recv_timeout(`, or a call to a function that does (followed through calls
#           and `use` imports across the test files).

[timing]
host::an_interrupt_stops_any_running_call_promptly
host::a_time_limit_stops_calls_by_the_hosts_clock
tables::colliding_integer_keys_run_out_of_fuel
libs_coverage::getenv_is_metered
libs_coverage::io_is_metered
sweep1_fuzz::oracle_address_split_and_wall_cut
sweep1_sandbox::s7_index_chain_amplification
sweep1_sandbox::hostile_fuzz
sweep1_soak::vararg_growth_is_paid_for_in_fuel
sweep2_sec::sec2_8_known_seed_collisions_stay_bounded
sweep3_sec::sec3_1_2_interrupt_and_time_limit_stop_long_natives
sweep3_sec::sec3_17_host_load_is_interruptible
sweep3_sec::error_naming_work_is_charged
sweep3_sec::sec3_stdlib_work_is_charged
sweep3_sec::hostile_fuzz_budgets_and_natives
sweep3_sec::fuel_tracks_time_for_every_function
sweep3_sec::lr29_huge_replacements_and_joins_stop_promptly
sweep3_stab::interrupts_and_time_limits_fired_repeatedly
sweep4_api::api4_host_function_return_checks_interrupt_and_deadline
sweep4_sec::sec4_error_paths_and_option_strings_are_charged
sweep4_sec::sec4_8_atomic_phase_stops_on_the_interrupt
sweep4_sec::sec4_12_sparse_traversals_are_charged
sweep4_sec::sec4_14_to_data_stops_at_its_budget
sweep4_sec::sec4_15_quadratic_compiles_are_charged
sweep4_sec::sec4_16_per_argument_work_is_charged
sweep5_sec::s5sec_1_nested_interpolations_are_charged_and_capped
sweep5_sec::s5sec_2_float_string_arguments_are_charged
sweep5_sec::s5sec_3_output_is_paid_as_it_grows
sweep5_gc::s5gc_1_many_lookups_in_one_charge_each_pay
sweep5_gc::s5gc_2_sparse_slabs_are_skipped
sweep5_gc::s5gc_3_interner_walks_are_charged
sweep5b_walks::s5b_walk_1_thread_stacks_are_counted
sweep5b_walks::s5b_walk_2_free_slots_at_the_end_are_not_walked
sweep5b_walks::s5b_walk_3_long_mode_strings_are_not_scanned
sweep5b_walks::s5b_walk_4_resume_chain_walks_are_charged
sweep5b_open::s5b_open_aimed_keys_are_metered
sweep5b_cost::cost_fuzz_quick
sweep5b_cost::s5b_cost_1_collector_charges_every_stack_slot
sweep5b_cost::s5b_cost_2_rehash_at_every_new_key_is_charged
sweep5b_cost::s5b_cost_3_ephemeron_entries_are_charged
sweep5b_cost::s5b_cost_4_new_coroutines_reuse_closed_stacks
sweep5c_open2::s5c_open2_many_tables_aimed_keys_are_bounded
sweep5c_open2::s5c_open2_cold_tables_aimed_keys_cost_little_more_than_plain_keys
sweep5c_front::s5c_front_1_interpolated_strings_parse_in_linear_time
sweep5c_front::s5c_front_2_scan_work_reads_the_interrupt
sweep5c_front::s5c_front_12_huge_load_stops_promptly_wherever_interrupted
sweep6::s6t_1_big_constructors_with_named_fields_are_paid
sweep6::s6gc_1_wrap_pays_for_copying_an_error
sweep6::s6gc_2_marking_scattered_objects_is_paid
sweep6::s6gc_2e_the_atomic_phase_stops_at_the_fuel_limit
sweep6::s6gc_2e_a_big_table_is_marked_a_chunk_a_step
sweep6::sec7_t4_a_refused_rehash_reads_nothing
sweep6::sec7_t4_a_growth_under_a_piece_a_call_is_timed_paid_and_made
sweep6::sec7_g1_a_call_scans_no_more_prepaid_slots_than_its_steps_pay_for
sweep6::sec7_g1_growth_report
sweep6_tables::s6t_2_sparse_traversals_are_paid
sweep6_tables::s6t_3_reseeding_a_big_part_is_paid
sweep6_tables::s6t_rehash_at_a_million_keys_is_paid
sweep6_tables::s6t_intern_new_strings_pay_for_regrows
sweep6_err::s6_1_errors_under_err_closing_chains_are_paid
sweep6_err::s6_2_nested_protected_call_levels_are_paid
sweep6_err::s6gc_h1_tracebacks_are_made_for_the_host_only
sweep6_heap::s6_5_big_natives_stop_at_the_time_limit
sweep6_gcpart::s6gc_2e_a_step_does_no_more_than_the_call_pays_for
sweep6_gcpart::s6gc_2e_the_collector_reads_the_deadline_often
sweep6_gcpart::s6gc_a_slab_is_cut_a_piece_at_a_time
sec_metering::sec_m6_open_upvalues_moved_are_charged
sec_metering::sec_m7_register_lists_are_charged
perf_numeric::field_reads_do_not_stall
perf_numeric::method_lookups_do_not_stall
perf_tables::moves_over_a_big_part_of_other_keys_cost_what_they_are_charged
perf_tables::lr32_pairs_over_a_big_part_finds_its_place_cheaply
perf_c_gap::lr_11_long_sets_cost_what_they_are_charged
perf_c_gap::pack_formats_are_charged_by_what_they_read
residuals::res_front_no_long_stretch_without_a_look
residuals::res_open2_worst_layout_through_a_chain_is_bounded
residuals::res_table_resize_resumes_in_1ms_slices
residuals::sec7_n5_an_in_place_find_does_not_search_twice
residuals::sec7_t2_a_written_table_resumes_its_resize
sweep6_front::s6_front_4_huge_hostile_loads_stop_promptly
rlua_types::check_fuzz_on_rlua_mutations

[env]
libs_coverage::getenv_is_metered
sweep3_sec::hostile_fuzz_budgets_and_natives
sweep3_sec::lr29_huge_replacements_and_joins_stop_promptly
sweep5b_cost::s5b_cost_2_rehash_at_every_new_key_is_charged
sweep5b_cost::s5b_cost_3_ephemeron_entries_are_charged
sweep5b_cost::s5b_cost_4_new_coroutines_reuse_closed_stacks
sweep5c_front::s5c_front_1_interpolated_strings_parse_in_linear_time
sweep1_sandbox::s7_index_chain_amplification
sweep1_sandbox::hostile_fuzz
sweep1_soak::vararg_growth_is_paid_for_in_fuel
sweep3_sec::sec3_17_host_load_is_interruptible
sweep3_sec::error_naming_work_is_charged
sweep3_sec::fuel_tracks_time_for_every_function
sweep4_sec::sec4_14_to_data_stops_at_its_budget
sweep5c_front::s5c_front_2_scan_work_reads_the_interrupt
residuals::res_front_no_long_stretch_without_a_look

[oracle]
front_equiv::iterative_front_end_matches_recursive
front_proof::equiv::corpus_old_and_new_agree
front_proof::equiv::mutated_corpus_old_and_new_agree
sweep4_fuzz::focus_front_equiv
sweep4_fuzz::coverage
sweep6_front::s6_front_lr6_compound_concat_errors_where_its_desugaring_does
sweep6_front::s6_front_lr6_interp_operand_lines_match_desugaring

[clock-deterministic]
host::scripts_cannot_catch_an_interrupt
sweep1_fuzz::ddmin_stops_at_its_deadline
sweep1_fuzz::fx2_2_with_timeout_never_detaches
sweep1_fuzz::clock_output_is_no_fast_slow_difference
sweep3_sec::lr29_concat_looks_at_the_stop_between_pieces
sweep3_sec::lr29_a_growing_buffer_looks_at_the_stop_between_pieces
sweep3_sec::state_usable_after_interrupt_and_reset
sweep3_sec::panicking_clock_poisons_the_state
sweep3_stab::vms_created_and_dropped_free_everything
sweep4_api::api12_os_clocks_are_the_hosts
sweep5_api::s5api_probe_panics_in_host_callbacks
sweep5_api::s5api_probe_extreme_clocks
sweep5b_cost::s5b_cost_harness_failed_setup_is_an_outcome
sweep6::sec7_t3_a_kept_resize_counts_its_new_part_whole
residuals::sec8_f4_a_resize_thrown_away_by_a_write_is_released_there
residuals::sec8_f6_a_dropped_tail_is_not_counted
sweep6::sec7_g1_the_collectors_trace_changes_no_fuel
sweep6_tables::s6t_regrow_moves_between_looks_at_the_deadline
sweep6_tables::s6t_regrow_stopped_mid_move_and_swept_mid_move
sweep6_tables::s6t_key_long_keys_look_at_the_deadline_every_megabyte
sweep6_tables::s6t_eq_long_strings_compare_a_megabyte_at_a_time
sweep6_tables::s6t_eq_keys_of_one_hash_compare_one_key_at_most
sweep6_tables::s6t_load_long_constants_look_at_the_deadline_every_megabyte
sec_metering::sec_m4_long_string_loops_look_at_the_deadline
sec_metering::sec_m12_pack_formats_look_at_the_deadline
sec_metering::fx2_5_a_long_literal_is_compiled_between_looks
sec_metering::sec7_n3_comments_names_numerals_and_blanks_look_at_the_deadline
residuals::res_bulk_natives_look_at_the_deadline_every_megabyte
residuals::res_table_resizes_look_at_the_deadline
residuals::res_table_stopped_resize_leaves_the_table_unchanged
residuals::res_table_resize_progresses_in_short_slices
residuals::sec7_h3_a_full_collection_trims_between_looks
residuals::lr29b_a_big_old_part_is_freed_between_looks
sweep6_review::s6r_3_native_lookups_settle_long_keys
sweep6_review::s6r_8_gsub_literal_replacement_looks_at_the_deadline
sweep6_front::s6_front_4_deferred_frees_are_charged_until_freed
residuals::lr29d_a_resize_is_charged_once_however_the_call_is_sliced
residuals::lr29d_a_resize_thrown_away_stays_paid
residuals::res_table_a_growth_given_up_goes_on_in_place
residuals::res_table_stopped_resizes_match_c_lua
residuals::res_table_fuel_matrix_is_the_same_on_both_storages
residuals::seg_a_segmented_array_part_grows_without_copying
residuals::sec8_f1_a_call_stopped_at_its_deadline_reports_its_fuel_left

[hang-guard]
red_team::finalizers_are_refused
red_team::single_library_calls_cannot_run_forever
red_team::the_limit_cannot_be_caught
red_team::shared_tables_cannot_blow_up_on_the_rust_side
red_team::memory_blowups_of_every_shape
red_team::deep_recursion_is_an_error_not_a_crash
red_team::pathological_patterns_stop
red_team::coroutine_tricks
red_team::collector_abuse
red_team::source_text_attacks
red_team::huge_values_and_argument_counts
sweep1_sandbox::s1_integer_key_hash_flood
sweep1_sandbox::s2_border_linear_walk
sweep1_sandbox::s3_next_scans_empty_array
sweep1_sandbox::s4_huge_name_in_errors_and_tostring
sweep1_sandbox::s5_string_compare_uncharged
sweep1_sandbox::s6_string_coercion_uncharged
sweep1_sandbox::s8_ephemeron_chain_quadratic
sweep1_sandbox::s9_pack_huge_c_panics
sweep1_sandbox::s11_packsize_overflow
sweep1_sandbox::s19_os_time_overflow
sweep1_sandbox::s20_chunk_name_rescanned_per_error
sweep1_sandbox::s21_select_mininteger
sweep1_sandbox::limits_survive_every_unwinding_path
sweep2_sec::hostile_fuzz_fast_vs_full
sweep2_sec::state_usable_after_limits_in_new_paths
sweep2_sec::sec2_1_long_key_compared_once
sweep2_sec::sec2_2_patterns_charge_their_work
sweep2_sec::sec2_3_fast_loop_fuel_matches_through_collections
sweep2_sec::sec2_4_format_charges_what_it_reads
sweep2_sec::sec2_5_plain_find_charges_compares
sweep2_sec::sec2_6_pattern_errors_are_paid_for
sweep2_sec::sec2_7_no_seed_free_string_collisions
sweep3_sec::host_lua_mutual_recursion_stops
sweep6::fx2_8_gsub_past_the_string_limit_stops
sweep6_review::s6r_7_a_key_whose_hash_is_zero
rlua_types::check_is_bounded_on_deep_and_wide_inputs
rlua_types::check_stops_at_its_work_bound_with_a_warning
rlua_types::annotations_never_change_behaviour
sweep1_fuzz::generator_self_check
sweep1_fuzz::rlua_continue_label_after_multiline_return
sweep1_fuzz::rlua_continue_twins_compile_and_agree
sweep1_fuzz::fuzz_11_nesting_budget
sweep1_fuzz::harness_known_non_bugs_and_planted_differences
sweep1_fuzz::c_nondeterminism_classify_is_deterministic
sweep1_fuzz::next_first_key_counts_remedy_seed_runs_but_not_plants
sweep1_fuzz::rlua_twin_order_counts_its_runs_but_not_plants
sweep1_fuzz::c_lua_close_goto_bug_segment_error
sweep1_fuzz::c_lua_close_goto_bug_is_classified_narrowly
sweep1_fuzz::c_lua_compare_key_bug_is_classified
sweep1_fuzz::oracle_crash_does_not_end_the_driver
sweep1_fuzz::memory_cut_keeps_ordinary_allocations_the_memory_limit
sweep4_fuzz::focus_quick
sweep4_fuzz::s4fuzz_1_gmatch_end_returns_nothing
sweep4_fuzz::s4fuzz_3_move_compares_with_eq
sweep4_fuzz::s4fuzz_4_move_argument_order
sweep4_fuzz::s4fuzz_5_names_end_at_zero_byte
sweep4_fuzz::s4fuzz_6_pairs_metamethod_yields
sweep4_fuzz::s4fuzz_7_close_yields_while_unwinding
sweep4_fuzz::s4fuzz_7_pairs_yields_under_pcall
sweep4_fuzz::s4fuzz_8_string_arith_fallback_called_from_library
sweep4_fuzz::s4fuzz_11_tbc_error_line
sweep4_fuzz::s4fuzz_12_failed_sort_keeps_progress
sweep4_fuzz::s4fuzz_13_fuel_used_is_exact_at_a_memory_error
sweep4_fuzz::s4fuzz_9_right_nested_concat_is_one_instruction
sweep4_fuzz::s4fuzz_14_proxy_sort_in_place
sweep4_fuzz::s4fuzz_15_plain_sort_in_place
sweep4_fuzz::s4fuzz_2_uncallable_close_message

[time-capped]
sweep1_fuzz::fuzz_generated
sweep1_fuzz::fuzz_mutated
sweep1_fuzz::fuzz_rlua
sweep4_fuzz::fuzz_focus
sweep4_fuzz::fuzz_focus_mutated
sweep5b_cost::cost_fuzz_long
sweep1_soak::long_vms_created_and_dropped
sweep1_soak::long_scripts_loaded_and_unloaded
sweep1_soak::long_long_lived_script_churn_plateaus
sweep1_soak::long_limits_hit_repeatedly_vm_stays_exact
sweep1_soak::long_host_objects_created_and_released
sweep1_soak::long_emergency_collections_at_the_cap
sweep1_soak::vms_created_and_dropped
sweep1_soak::scripts_loaded_and_unloaded
sweep1_soak::long_lived_script_churn_plateaus
sweep1_soak::long_lived_script_churn_with_shared_upvalues_plateaus
sweep1_soak::limits_hit_repeatedly_vm_stays_exact
sweep1_soak::host_objects_created_and_released
sweep1_soak::emergency_collections_at_the_cap
sweep3_stab::scripts_loaded_and_unloaded_return_to_baseline
sweep3_stab::long_lived_script_plateaus_and_paths_agree
sweep3_stab::churn_in_c_lua_for_comparison
sweep3_stab::coroutines_created_and_abandoned_return_to_baseline
sweep3_stab::limits_hit_repeatedly_leave_the_vm_exact
sweep3_stab::tracked_userdata_app_data_and_roots_do_not_pile_up
sweep3_stab::fixed_seed_runs_replay_exactly

[probe]
perf_tables::probe_moves
residuals::res_front_probe_blind_stretches
residuals::res_open2_probe_far
residuals::res_table_growth_measures
residuals::res_table_growth_probe
sweep1_fuzz::probe
sweep1_fuzz::probe_direct
sweep1_fuzz::oracle_child
sweep1_sandbox::probe
sweep2_sec::probe
sweep3_sec::probe_costly
sweep3_sec::probe_compile_scaling
sweep4_sec::probe_atomic
sweep5_gc::probe_metering
sweep5b_cost::cost_probe
sweep5b_open::probe_big
sweep5b_open::probe_dram
sweep5b_open::probe_index_dram
sweep5b_open::probe_index_big
sweep5c_open2::probe_far
sweep6_tables::probe_sizes

[known]