feat(scheduler-sim-discrete-clock): remove the simulator speed argument and shadow copy (task 3.1)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
eb5f339541
commit
aa2bb6d090
32 changed files with 72 additions and 129 deletions
|
|
@ -316,7 +316,8 @@ sched_core_session_test = executable(
|
|||
|
||||
# Contract test for clock virtualization and session timing (scheduler-core
|
||||
# spec, task 4.5, Req 5 AC 3 / AC 12): xce_core_now()'s two-anchor + speed
|
||||
# formula for all four documented modes, xce_core_tlog_format()'s tlog
|
||||
# formula (normal 1/1, simulation frozen 0/1, plus formula tests with other
|
||||
# ratios), xce_core_tlog_format()'s tlog
|
||||
# integration (frozen virtual time shown instead of info->time's real
|
||||
# wall-clock read), and session_start/session_duration_ns tracking across a
|
||||
# real xce_core_go()/xce_core_end_session() cycle. Same white-box #include
|
||||
|
|
@ -563,7 +564,7 @@ sched_admin_request_test = executable(
|
|||
# be ReplayHeader, first data message must be SnapshotEntry), locating the
|
||||
# most recent SnapshotEntry at or before --sim-start-ts, loading it via the
|
||||
# real xce_sched_core_load_snapshot(), and setting the virtual clock's
|
||||
# anchors from the loaded snapshot's timestamp and requested speed. Same
|
||||
# anchors from the loaded snapshot's timestamp, frozen (speed 0/1). Same
|
||||
# white-box #include pattern as sched_snapshot_save_load_test (../src/core.c,
|
||||
# ../src/core_clock.c, ../src/snapshot.c, ../src/snapshot_wire.c,
|
||||
# ../src/snapshot_load.c) PLUS ../src/recording.c (used only to build real
|
||||
|
|
@ -1175,9 +1176,9 @@ sched_repl_limit_table_test = executable(
|
|||
# sections in a fixed order, aligns every command's description to one
|
||||
# consistent column position throughout, lists `info config` together with
|
||||
# its `info` siblings in the state-inspection section, lists `set units`
|
||||
# alongside `set speed`/`set output`/`set verify` in the snapshot-and-
|
||||
# parameters section, and enumerates the complete BP_KIND_TABLE event-type
|
||||
# set on the `break` line. Same white-box #include pattern as
|
||||
# alongside `set output`/`set verify` in the snapshot-and-parameters
|
||||
# section (`set speed` was removed, scheduler-sim-discrete-clock), and
|
||||
# enumerates the complete BP_KIND_TABLE event-type set on the `break` line. Same white-box #include pattern as
|
||||
# sched_repl_resource_table_test above (core.c, core_clock.c, core_events.c,
|
||||
# core_session.c, decision.c, plugin.c, plugins/builtin_fcfs.c, recording.c,
|
||||
# recording_session.c, sim.c, sim_loop.c, sim_record.c, sim_verify.c,
|
||||
|
|
@ -1208,8 +1209,9 @@ sched_repl_help_test = executable(
|
|||
# standalone .replay file a FRESH sched_sim_driver_start() can load, landing
|
||||
# on the exact position the snapshot was taken at (the task's own central
|
||||
# Observable, proved end to end via a forked child + a second, real
|
||||
# sched_sim_driver_start() call in the parent); `set speed`/`set output`/
|
||||
# `set verify` mutate the parameters `info config` reports. Same white-box
|
||||
# sched_sim_driver_start() call in the parent); `set output`/`set verify`
|
||||
# mutate the parameters `info config` reports, and the removed `set speed`
|
||||
# prints a removal message and changes nothing. Same white-box
|
||||
# #include pattern as sched_repl_breakpoints_inspection_test above (core.c,
|
||||
# core_clock.c, core_events.c, core_session.c, decision.c, plugin.c,
|
||||
# plugins/builtin_fcfs.c, recording.c, recording_session.c, sim.c,
|
||||
|
|
|
|||
|
|
@ -4,16 +4,20 @@
|
|||
*
|
||||
* Observable under test:
|
||||
* - xce_core_now() implements the two-anchor + speed formula (Req 5 AC 3)
|
||||
* exactly, for all four documented operating modes (normal, discrete
|
||||
* simulation, real-time simulation, fast/slow simulation), given fixed
|
||||
* anchor values -- no sleep-based real-elapsed-time assertions. Where a
|
||||
* mode's own definition makes the output track real wall-clock time
|
||||
* (normal, real-time, fast/slow), the test brackets the result between
|
||||
* two back-to-back CLOCK_MONOTONIC reads taken immediately before/after
|
||||
* exactly, given fixed anchor values -- no sleep-based
|
||||
* real-elapsed-time assertions. The product uses two settings of the
|
||||
* speed atoms: 1/1 in normal mode and 0/1 (frozen) in simulation mode
|
||||
* (scheduler-sim-discrete-clock: the simulator has no speed modes).
|
||||
* Three further tests exercise the formula itself with an arbitrary
|
||||
* virtual anchor and with ratios 1/1, N/1 and 1/N; they test the
|
||||
* arithmetic, not any product mode. Where the ratio is non-zero the
|
||||
* output tracks real wall-clock time, so the test brackets the result
|
||||
* between two back-to-back CLOCK_MONOTONIC reads taken immediately
|
||||
* before/after
|
||||
* the call -- deterministic (time is monotonic, so the bracket always
|
||||
* holds) and fast (nanoseconds of real work between the two reads), NOT
|
||||
* the sleep-then-check-approximate-elapsed pattern this task forbids.
|
||||
* Discrete-simulation (frozen, speed=0/1) collapses the bracket to an
|
||||
* Simulation mode (frozen, speed=0/1) collapses the bracket to an
|
||||
* exact equality since elapsed*0/den is always 0 regardless of when the
|
||||
* test runs.
|
||||
* - xce_core_tlog_format() (core_clock.c's registered tlog_format_func)
|
||||
|
|
@ -161,12 +165,11 @@ static void test_xce_core_now_discrete_simulation_frozen_at_event_ts(void)
|
|||
}
|
||||
|
||||
static void
|
||||
test_xce_core_now_realtime_simulation_tracks_wall_clock_from_anchor(void)
|
||||
test_xce_core_now_unit_ratio_tracks_wall_clock_from_virtual_anchor(void)
|
||||
{
|
||||
/* Simulation real-time (AC 3's table): virtual_clock_base=snapshot ts,
|
||||
* real_clock_base=wall at load, speed=1/1 -- tracks wall clock from the
|
||||
* virtual anchor: result is between [snapshot_ts, snapshot_ts +
|
||||
* (after-before)]. */
|
||||
/* Formula test: an arbitrary virtual_clock_base, real_clock_base=wall
|
||||
* now, speed=1/1 -- the result advances with the wall clock from the
|
||||
* virtual anchor: it lies in [anchor, anchor + (after-before)]. */
|
||||
xce_sched_core_t core;
|
||||
const uint64_t SNAPSHOT_TS = 500000000000ULL;
|
||||
uint64_t before, result, after;
|
||||
|
|
@ -182,10 +185,10 @@ test_xce_core_now_realtime_simulation_tracks_wall_clock_from_anchor(void)
|
|||
TEST_ASSERT_TRUE(result <= SNAPSHOT_TS + (after - before));
|
||||
}
|
||||
|
||||
static void test_xce_core_now_fast_simulation_scales_up_by_speed(void)
|
||||
static void test_xce_core_now_ratio_above_one_scales_elapsed_up(void)
|
||||
{
|
||||
/* Simulation fast (AC 3's table): speed=N/1 -- runs N times faster than
|
||||
* wall clock. Bracket scaled by N. */
|
||||
/* Formula test: speed=N/1 -- elapsed wall time is multiplied by N.
|
||||
* Bracket scaled by N. */
|
||||
xce_sched_core_t core;
|
||||
const uint64_t SNAPSHOT_TS = 1000ULL;
|
||||
const uint64_t N = 1000ULL;
|
||||
|
|
@ -202,11 +205,10 @@ static void test_xce_core_now_fast_simulation_scales_up_by_speed(void)
|
|||
TEST_ASSERT_TRUE(result <= SNAPSHOT_TS + (after - before) * N);
|
||||
}
|
||||
|
||||
static void test_xce_core_now_slow_simulation_scales_down_by_speed(void)
|
||||
static void test_xce_core_now_ratio_below_one_scales_elapsed_down(void)
|
||||
{
|
||||
/* Simulation slow (AC 3's table): speed=1/N -- runs N times slower than
|
||||
* wall clock. Bracket scaled down by N (+1 for integer-division
|
||||
* rounding slack). */
|
||||
/* Formula test: speed=1/N -- elapsed wall time is divided by N.
|
||||
* Bracket scaled down by N (+1 for integer-division rounding slack). */
|
||||
xce_sched_core_t core;
|
||||
const uint64_t SNAPSHOT_TS = 1000ULL;
|
||||
const uint64_t N = 1000ULL;
|
||||
|
|
@ -494,9 +496,9 @@ int main(void)
|
|||
RUN_TEST(test_xce_core_now_normal_mode_matches_wall_clock);
|
||||
RUN_TEST(test_xce_core_now_discrete_simulation_frozen_at_event_ts);
|
||||
RUN_TEST(
|
||||
test_xce_core_now_realtime_simulation_tracks_wall_clock_from_anchor);
|
||||
RUN_TEST(test_xce_core_now_fast_simulation_scales_up_by_speed);
|
||||
RUN_TEST(test_xce_core_now_slow_simulation_scales_down_by_speed);
|
||||
test_xce_core_now_unit_ratio_tracks_wall_clock_from_virtual_anchor);
|
||||
RUN_TEST(test_xce_core_now_ratio_above_one_scales_elapsed_up);
|
||||
RUN_TEST(test_xce_core_now_ratio_below_one_scales_elapsed_down);
|
||||
RUN_TEST(test_xce_sched_core_init_seeds_normal_mode_defaults);
|
||||
RUN_TEST(test_xce_core_set_wallclock_anchor_seeds_real_epoch_time);
|
||||
RUN_TEST(test_xce_core_set_wallclock_anchor_null_core_is_a_safe_noop);
|
||||
|
|
|
|||
|
|
@ -2017,7 +2017,6 @@ static void run_group_d_child(const char* replay_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.interactive = true;
|
||||
|
||||
(void)sched_sim_driver_run(&sim, &args);
|
||||
|
|
|
|||
|
|
@ -860,9 +860,6 @@ test_repl_step_continue_to_completion_matches_batch_decision_sequence(void)
|
|||
memset(&args_batch, 0, sizeof(args_batch));
|
||||
args_batch.replay_path = fixture_path;
|
||||
args_batch.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args_batch.sim_speed = 0; /* frozen -- deterministic, no wall-clock
|
||||
* skew, matching every other equivalence
|
||||
* fixture in this directory */
|
||||
args_batch.output_path = batch_out_path;
|
||||
args_batch.interactive = false;
|
||||
|
||||
|
|
@ -892,7 +889,6 @@ test_repl_step_continue_to_completion_matches_batch_decision_sequence(void)
|
|||
memset(&args_repl, 0, sizeof(args_repl));
|
||||
args_repl.replay_path = fixture_path;
|
||||
args_repl.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args_repl.sim_speed = 0;
|
||||
args_repl.output_path = repl_out_path;
|
||||
args_repl.interactive = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -659,7 +659,6 @@ static void child_run_repl_and_exit(const char* replay_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.interactive = true;
|
||||
|
||||
(void)sched_sim_driver_run(&sim, &args);
|
||||
|
|
|
|||
|
|
@ -741,7 +741,6 @@ static void child_prepause_then_quit(const char* replay_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.interactive = true;
|
||||
|
||||
(void)sched_sim_driver_run(&sim, &args);
|
||||
|
|
@ -867,7 +866,6 @@ static void child_continue_then_inspect(const char* replay_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.interactive = true;
|
||||
|
||||
(void)sched_sim_driver_run(&sim, &args);
|
||||
|
|
@ -962,7 +960,6 @@ static void child_continue_twice_after_complete(const char* replay_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.interactive = true;
|
||||
|
||||
(void)sched_sim_driver_run(&sim, &args);
|
||||
|
|
@ -1067,7 +1064,6 @@ static void child_step_then_quit(const char* replay_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.interactive = true;
|
||||
|
||||
(void)sched_sim_driver_run(&sim, &args);
|
||||
|
|
|
|||
|
|
@ -2759,7 +2759,6 @@ static void det_run_scripted_repl_session(const char* fixture_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = (char*)fixture_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.output_path = out_path;
|
||||
args.interactive = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -638,7 +638,6 @@ static char* run_repl_via_pty(const char* replay_path, const char* script)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.interactive = true;
|
||||
|
||||
(void)sched_sim_driver_run(&sim, &args);
|
||||
|
|
|
|||
|
|
@ -776,7 +776,6 @@ static void child_run_repl_and_exit(const char* replay_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.interactive = true;
|
||||
|
||||
(void)sched_sim_driver_run(&sim, &args);
|
||||
|
|
|
|||
|
|
@ -676,7 +676,6 @@ static void child_step_snapshot_quit(const char* replay_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0; /* frozen virtual clock -- deterministic ts */
|
||||
args.interactive = true;
|
||||
|
||||
(void)sched_sim_driver_run(&sim, &args);
|
||||
|
|
@ -812,7 +811,6 @@ static void child_step_snapshot_noarg_quit(const char* replay_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.interactive = true;
|
||||
|
||||
(void)sched_sim_driver_run(&sim, &args);
|
||||
|
|
@ -1312,8 +1310,6 @@ static void test_info_config_reports_current_parameters(void)
|
|||
g_cfg_sim.repl_state = repl_state_ensure(&g_cfg_sim);
|
||||
TEST_ASSERT_NOT_NULL(g_cfg_sim.repl_state);
|
||||
|
||||
g_cfg_sim.sim_speed_num = 3;
|
||||
g_cfg_sim.sim_speed_den = 1;
|
||||
g_cfg_sim.verify = true;
|
||||
g_cfg_sim.repl_state->event_index = 7;
|
||||
g_cfg_sim.repl_state->session_count = 2;
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@
|
|||
* this file exercises the same real sched_sim_driver_run() end-to-end,
|
||||
* forked-child, real-stdout-capture technique. Discrete-simulation
|
||||
* determinism note (research.md's own key finding, load-bearing for every
|
||||
* test below): `child_run_repl_and_exit()` sets args.sim_speed = 0, which
|
||||
* sim_set_virtual_clock() (sim.c) stores as core.speed_num == 0; with
|
||||
* test below): simulation mode always runs the core clock frozen --
|
||||
* sim_set_virtual_clock() (sim.c) stores core.speed_num == 0; with
|
||||
* speed_num == 0, xce_core_now()'s (core_clock.c) `elapsed * num / den` term
|
||||
* is always exactly zero, so xce_core_now() returns EXACTLY the raw
|
||||
* nanosecond `ts` value most recently passed to sim_advance_virtual_clock()
|
||||
|
|
@ -634,9 +634,10 @@ static char* read_whole_file(const char* path)
|
|||
/* child_run_repl_and_exit / run_repl_fixture_and_capture - the same fork/
|
||||
* freopen/waitpid/capture shape test_repl_event_echo.c's own pair
|
||||
* establishes: run a scripted command sequence to completion against a real
|
||||
* sched_sim_driver_run(), capturing real stdout. args.sim_speed = 0 below is
|
||||
* this file's own load-bearing determinism note (see header comment) -- it
|
||||
* is what makes xce_core_now() return EXACTLY each event's own `ts`. */
|
||||
* sched_sim_driver_run(), capturing real stdout. The simulator's frozen
|
||||
* clock is this file's own load-bearing determinism note (see header
|
||||
* comment) -- it is what makes xce_core_now() return EXACTLY each event's
|
||||
* own `ts`. */
|
||||
static void child_run_repl_and_exit(const char* replay_path,
|
||||
const char* script_path,
|
||||
const char* capture_path)
|
||||
|
|
@ -655,7 +656,6 @@ static void child_run_repl_and_exit(const char* replay_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.interactive = true;
|
||||
|
||||
(void)sched_sim_driver_run(&sim, &args);
|
||||
|
|
|
|||
|
|
@ -603,7 +603,6 @@ static char* run_sim_and_capture_stdout(const char* base_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = base_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0; /* frozen -- deterministic, no wall-clock wait */
|
||||
args.alt_events_path = alt_path;
|
||||
|
||||
*out_rc = sched_sim_driver_run(&sim, &args);
|
||||
|
|
|
|||
|
|
@ -1461,7 +1461,6 @@ test_contention_parity_matches_real_normal_mode_recording_round_by_round(
|
|||
memset(&sim_args, 0, sizeof(sim_args));
|
||||
sim_args.replay_path = sim_r_path;
|
||||
sim_args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
sim_args.sim_speed = 0; /* frozen -- deterministic, no wall-clock skew */
|
||||
|
||||
memset(&sim, 0, sizeof(sim));
|
||||
g_capturing = 1;
|
||||
|
|
@ -1812,7 +1811,6 @@ static void run_multiround_contention_fixture(xce_sched_sim_driver_t* sim_out,
|
|||
memset(&sim_args, 0, sizeof(sim_args));
|
||||
sim_args.replay_path = r_path;
|
||||
sim_args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
sim_args.sim_speed = 0; /* frozen -- deterministic, no wall-clock skew */
|
||||
|
||||
memset(sim_out, 0, sizeof(*sim_out));
|
||||
rc = sched_sim_driver_run(sim_out, &sim_args);
|
||||
|
|
|
|||
|
|
@ -13,11 +13,10 @@
|
|||
* Testing Strategy: Unit (SimClock) and Integration (replay loop)): in
|
||||
* simulation mode the logical clock moves only at the start snapshot, at
|
||||
* each recorded event and at each recorded session, is set exactly (never
|
||||
* clamped, even backwards), and never drifts with real time. Every clock
|
||||
* test passes a non-zero speed through the still-present
|
||||
* sched_sim_args_t.sim_speed (DISCRETE_CLOCK_RED_SPEED) to prove the
|
||||
* simulator no longer reads it; task 3.1 removes that field and these
|
||||
* assignments while keeping the pinned-clock assertions.
|
||||
* clamped, even backwards), and never drifts with real time. (Task 2.1
|
||||
* proved RED by passing a non-zero speed through the simulator's speed
|
||||
* argument; task 3.1 removed that argument, and these tests keep asserting
|
||||
* the pinned clock.)
|
||||
*
|
||||
* White-box #include of the same simulator TU set test_sim_record_output.c
|
||||
* uses, with its link-satisfying stubs and stand-in picker; the stand-in
|
||||
|
|
@ -465,10 +464,6 @@ static void test_no_warning_when_option_absent(void)
|
|||
/* chosen value first, so the recorded start snapshot's ts is exact. */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
/* Task 2.1 RED: a non-zero speed through the still-present simulator
|
||||
* argument. The simulator must ignore it; removed with the field in 3.1. */
|
||||
#define DISCRETE_CLOCK_RED_SPEED 7
|
||||
|
||||
#define SNAP_TS 1000000000000ULL /* start snapshot, 1000 s */
|
||||
#define JOB_A 4101ULL
|
||||
#define JOB_B 4102ULL
|
||||
|
|
@ -622,7 +617,6 @@ static void sim_args_init(sched_sim_args_t* args, const char* replay_path)
|
|||
memset(args, 0, sizeof(*args));
|
||||
args->replay_path = replay_path;
|
||||
args->sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args->sim_speed = DISCRETE_CLOCK_RED_SPEED;
|
||||
}
|
||||
|
||||
/* Runs a batch replay with `sim` as the observed core. */
|
||||
|
|
|
|||
|
|
@ -580,7 +580,6 @@ test_sim_replay_shows_real_global_and_host_scoped_limit_usage(void)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
|
||||
rc = sched_sim_driver_run(&g_sim, &args);
|
||||
TEST_ASSERT_EQUAL_INT_MESSAGE(
|
||||
|
|
|
|||
|
|
@ -1368,7 +1368,6 @@ static void child_replay(const char* replay_path, const char* script_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0; /* frozen -- deterministic */
|
||||
args.interactive = true;
|
||||
|
||||
(void)sched_sim_driver_run(&sim, &args);
|
||||
|
|
|
|||
|
|
@ -1016,7 +1016,6 @@ test_normal_mode_recording_and_simulation_replay_produce_identical_decisions(
|
|||
memset(&sim_args, 0, sizeof(sim_args));
|
||||
sim_args.replay_path = r_path;
|
||||
sim_args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
sim_args.sim_speed = 0; /* frozen -- deterministic, no wall-clock skew */
|
||||
sim_args.output_path = s_path;
|
||||
|
||||
rc = sched_sim_driver_run(&sim, &sim_args);
|
||||
|
|
|
|||
|
|
@ -808,7 +808,6 @@ test_run_processes_multiple_sessions_in_order_and_no_longer_returns_enosys(void)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0; /* frozen -- deterministic final-clock assertion */
|
||||
|
||||
rc = sched_sim_driver_run(&sim, &args);
|
||||
|
||||
|
|
@ -865,7 +864,6 @@ test_run_deactivates_tlog_virtual_clock_logging_on_completion(void)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
|
||||
xce_core_set_active_for_logging((xce_sched_core_t*)0x1); /* bogus sentinel */
|
||||
|
||||
|
|
@ -983,7 +981,6 @@ static char* run_sim_and_capture_stdout(const char* path, int* out_rc)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0; /* frozen -- deterministic, no wall-clock wait */
|
||||
|
||||
*out_rc = sched_sim_driver_run(&sim, &args);
|
||||
|
||||
|
|
|
|||
|
|
@ -444,7 +444,6 @@ static char* run_sim_and_capture_stdout(xce_sched_sim_driver_t* sim,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.verify = verify;
|
||||
|
||||
*out_rc = sched_sim_driver_run(sim, &args);
|
||||
|
|
@ -580,7 +579,6 @@ test_sim_driver_run_dispatches_a_job_with_available_resources(void)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
|
||||
rc = sched_sim_driver_run(&g_sim, &args);
|
||||
TEST_ASSERT_EQUAL_INT_MESSAGE(
|
||||
|
|
|
|||
|
|
@ -663,7 +663,6 @@ static void child_run_repl_and_exit(const char* replay_path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.interactive = true;
|
||||
|
||||
(void)sched_sim_driver_run(&sim, &args);
|
||||
|
|
@ -739,7 +738,6 @@ static char* run_sim_and_capture_stdout(const char* replay_path, int* out_rc)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = replay_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0; /* frozen -- deterministic, no wall-clock wait */
|
||||
/* args.interactive left false -- this is the headless/batch path. */
|
||||
|
||||
*out_rc = sched_sim_driver_run(&sim, &args);
|
||||
|
|
|
|||
|
|
@ -593,7 +593,6 @@ static void test_output_file_is_decodable_with_full_stream_symmetry(void)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = base_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0; /* frozen -- deterministic snapshot_ts */
|
||||
args.output_path = out_path;
|
||||
|
||||
rc = sched_sim_driver_run(&sim, &args);
|
||||
|
|
@ -786,7 +785,6 @@ static void test_output_file_reflects_alt_events_not_base_when_both_set(void)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = base_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
args.alt_events_path = alt_path;
|
||||
args.output_path = out_path;
|
||||
|
||||
|
|
|
|||
|
|
@ -1062,7 +1062,6 @@ static void test_contention_fixture_is_replayable_via_simulation_driver(void)
|
|||
memset(&sim_args, 0, sizeof(sim_args));
|
||||
sim_args.replay_path = r_path;
|
||||
sim_args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
sim_args.sim_speed = 0; /* frozen -- deterministic, no wall-clock skew */
|
||||
|
||||
memset(&sim, 0, sizeof(sim));
|
||||
rc = sched_sim_driver_run(&sim, &sim_args);
|
||||
|
|
|
|||
|
|
@ -866,7 +866,6 @@ test_reconciled_job_charges_resinuse_before_live_capacity_check(void)
|
|||
memset(&sim_args, 0, sizeof(sim_args));
|
||||
sim_args.replay_path = r_path;
|
||||
sim_args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
sim_args.sim_speed = 0; /* frozen -- deterministic, no wall-clock skew */
|
||||
|
||||
memset(&sim, 0, sizeof(sim));
|
||||
rc = sched_sim_driver_run(&sim, &sim_args);
|
||||
|
|
|
|||
|
|
@ -901,7 +901,6 @@ test_sim_replay_calls_account_jobs_once_per_round_within_session_window(
|
|||
memset(&sim_args, 0, sizeof(sim_args));
|
||||
sim_args.replay_path = r_path;
|
||||
sim_args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
sim_args.sim_speed = 0; /* frozen -- deterministic, no wall-clock skew */
|
||||
|
||||
memset(&sim, 0, sizeof(sim));
|
||||
rc = sched_sim_driver_run(&sim, &sim_args);
|
||||
|
|
@ -1010,7 +1009,6 @@ static void test_sim_replay_batch_mode_uses_the_same_round_boundary(void)
|
|||
memset(&sim_args, 0, sizeof(sim_args));
|
||||
sim_args.replay_path = r_path;
|
||||
sim_args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
sim_args.sim_speed = 0;
|
||||
|
||||
memset(&sim, 0, sizeof(sim));
|
||||
TEST_ASSERT_EQUAL_INT(0, sim.interactive); /* batch: default-zero, never set */
|
||||
|
|
|
|||
|
|
@ -704,7 +704,6 @@ static char* run_sim_and_capture_stdout(const char* path,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0; /* frozen -- deterministic, no wall-clock wait */
|
||||
args.verify = verify;
|
||||
|
||||
*out_rc = sched_sim_driver_run(out_sim, &args);
|
||||
|
|
|
|||
|
|
@ -419,10 +419,6 @@ test_valid_fixture_reaches_ready_state_with_frozen_virtual_clock(void)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0; /* fast/frozen -- xce_core_now() stays pinned to
|
||||
* virtual_clock_base regardless of real elapsed
|
||||
* time, giving this test a deterministic,
|
||||
* non-flaky assertion. */
|
||||
|
||||
rc = sched_sim_driver_start(&sim, &args);
|
||||
TEST_ASSERT_EQUAL_INT(0, rc);
|
||||
|
|
@ -439,8 +435,6 @@ test_valid_fixture_reaches_ready_state_with_frozen_virtual_clock(void)
|
|||
memory_order_acquire));
|
||||
TEST_ASSERT_EQUAL_UINT64(1ULL, atomic_load_explicit(&(sim.core.speed_den),
|
||||
memory_order_acquire));
|
||||
TEST_ASSERT_EQUAL_UINT64(0ULL, sim.sim_speed_num);
|
||||
TEST_ASSERT_EQUAL_UINT64(1ULL, sim.sim_speed_den);
|
||||
|
||||
/* "Ready-to-run" -- no session is active, load_snapshot()'s own
|
||||
* precondition would otherwise have been violated. */
|
||||
|
|
@ -481,7 +475,6 @@ static void test_valid_fixture_activates_virtual_clock_for_tlog_logging(void)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0;
|
||||
|
||||
rc = sched_sim_driver_start(&sim, &args);
|
||||
TEST_ASSERT_EQUAL_INT(0, rc);
|
||||
|
|
@ -518,7 +511,6 @@ static void test_missing_initial_snapshot_entry_fails_cleanly(void)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = header_only_path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 1;
|
||||
|
||||
rc = sched_sim_driver_start(&sim, &args);
|
||||
TEST_ASSERT_TRUE(rc < 0);
|
||||
|
|
@ -546,7 +538,6 @@ static void test_first_message_not_replayheader_fails_cleanly(void)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 1;
|
||||
|
||||
rc = sched_sim_driver_start(&sim, &args);
|
||||
TEST_ASSERT_TRUE(rc < 0);
|
||||
|
|
@ -568,7 +559,6 @@ static void test_missing_replay_file_fails_cleanly(void)
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = "/nonexistent/path/does_not_exist.replay";
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 1;
|
||||
|
||||
rc = sched_sim_driver_start(&sim, &args);
|
||||
TEST_ASSERT_TRUE(rc < 0);
|
||||
|
|
|
|||
|
|
@ -1517,7 +1517,6 @@ static char* run_sim_and_capture_stdout(const char* path, bool verify,
|
|||
memset(&args, 0, sizeof(args));
|
||||
args.replay_path = path;
|
||||
args.sim_start_ts = SCHED_SIM_START_TS_LATEST;
|
||||
args.sim_speed = 0; /* frozen -- deterministic, no wall-clock wait */
|
||||
args.verify = verify;
|
||||
|
||||
*out_rc = sched_sim_driver_run(&sim, &args);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue