myxce/src/scheduler/testsuite/test_trace_equivalence.h
Rongsong Shen 2e733994c1
test(scheduler-sim-decision-trace): prove tracing never changes scheduling
Task 6.3: the contention and extra replays run with tracing off, all
jobs at summary and full level, and a job subset, in step and continue
mode; decisions, full pend reasons, --sim-output recordings, snapshots,
--sim-verify results and per-step accounting dumps are identical.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 16:49:26 +00:00

38 lines
1.3 KiB
C

/*
* test_trace_equivalence.h - shared between test_trace_equivalence.c (the
* scenarios) and test_trace_equivalence_cmp.c (the comparisons);
* scheduler-sim-decision-trace task 6.3.
*/
#ifndef TEST_TRACE_EQUIVALENCE_H
#define TEST_TRACE_EQUIVALENCE_H
#include "typemap.h"
/* The recorded sessions of a .replay file, decoded. */
typedef struct {
replay_session_t** s;
int n;
int ndispatch;
int npend;
int npend_detail; /* pends with host/resource reasons */
} sessions_t;
/* Each comparison returns NULL when equal, else a malloc'd description of
* the first difference (the caller frees it). */
/* First differing line of two texts. */
char* text_diff(const char* a, const char* b);
/* Byte comparison of two .replay files (recordings or REPL snapshots)
* apart from the header's wall-clock recordingStartWall. */
char* recording_diff(const char* a_path, const char* b_path);
/* Decodes every ReplaySession of a .replay file (asserts it is readable). */
void sessions_read(const char* path, sessions_t* out);
void sessions_free(sessions_t* s);
/* Session rounds, decision ops, times, jobs, allocation hosts and counts,
* and pend reasons in full (job_preason_eq()). */
char* sessions_diff(const sessions_t* a, const sessions_t* b);
#endif