feat(libxce-alloc-preason-equality): drop sim verify tests that duplicate libxce alloc_eq coverage (task 5.1)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-09-28 11:04:19 +00:00
parent 24b057189f
commit a9c984775f
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
2 changed files with 1 additions and 87 deletions

View file

@ -69,7 +69,7 @@ Test-first throughout (red → green → refactor). Every sub-task leaves the bu
- _Depends: 2.1, 3.1, 4.1, 4.2_
- [ ] 5. Validation
- [ ] 5.1 Remove duplicated coverage from the verification unit tests
- [x] 5.1 Remove duplicated coverage from the verification unit tests
- Remove the dispatch allocation-level tests that only re-prove the allocation comparisons now owned by libxce; keep the pending-decision, decision-level and integration tests, the inverted reservation-start-time test from 4.3, and the description-text tests from 4.3.
- Done when the verification test file no longer duplicates libxce coverage and still passes.
- _Requirements: 6.1, 6.4_

View file

@ -632,51 +632,6 @@ static void test_dispatch_decisions_differing_jobid_mismatch(void)
printf("test_dispatch_decisions_differing_jobid_mismatch: PASS\n");
}
static void test_dispatch_decisions_differing_host_mismatch(void)
{
xce_alloc_t* res[1] = { make_test_alloc("gpu", "r", 1, 1.0, 0, 0) };
xce_host_alloc_t* host[1] = { make_test_host_alloc("hostA", res, 1) };
xce_job_alloc_t* expected_alloc = make_test_job_alloc(42, host, 1);
xce_alloc_t* res2[1] = { make_test_alloc("gpu", "r", 1, 1.0, 0, 0) };
xce_host_alloc_t* host2[1] = { make_test_host_alloc("hostB", res2, 1) };
xce_job_alloc_t* actual_alloc = make_test_job_alloc(42, host2, 1);
replay_decision_t expected = make_replay_dispatch_decision(expected_alloc);
xce_decision_t* actual = make_dispatch_decision(actual_alloc);
char* why = NULL;
TEST_ASSERT_FALSE(sim_decision_eq(&expected, actual, &why));
assert_why_names(why, "allocs[0](host=hostA).host: \"hostA\" != "
"\"hostB\"");
printf("test_dispatch_decisions_differing_host_mismatch: PASS\n");
}
static void test_dispatch_decisions_differing_resource_value_mismatch(void)
{
xce_alloc_t* res[1] = { make_test_alloc("gpu", "r", 1, 1.0, 0, 0) };
xce_host_alloc_t* host[1] = { make_test_host_alloc("hostA", res, 1) };
xce_job_alloc_t* expected_alloc = make_test_job_alloc(42, host, 1);
xce_alloc_t* res2[1] = { make_test_alloc("gpu", "r", 1, 2.0, 0, 0) };
xce_host_alloc_t* host2[1] = { make_test_host_alloc("hostA", res2, 1) };
xce_job_alloc_t* actual_alloc = make_test_job_alloc(42, host2, 1);
replay_decision_t expected = make_replay_dispatch_decision(expected_alloc);
xce_decision_t* actual = make_dispatch_decision(actual_alloc);
char* why = NULL;
TEST_ASSERT_FALSE(sim_decision_eq(&expected, actual, &why));
assert_why_names(why, "allocs[0](host=hostA).allocs[0](resname=gpu)."
"value: 1 != 2");
printf("test_dispatch_decisions_differing_resource_value_mismatch: "
"PASS\n");
}
/*
* test_dispatch_decisions_differing_from_timestamp_mismatch -
* libxce-alloc-preason-equality Requirement 5.1 (inverts the former
@ -714,44 +669,6 @@ static void test_dispatch_decisions_differing_from_timestamp_mismatch(void)
"PASS\n");
}
/*
* test_dispatch_decisions_differing_instid_still_match - bug-1844
* regression: `instid` (xce_alloc_t's per-process monotonic allocation-
* instance counter, stamped from `sched->core.nextid++` at allocation-build
* time -- scheduler.c's sched_get_id()) is an execution-order bookkeeping
* value, not part of a decision's semantic identity. It is the one field
* libxce's alloc_eq() excludes (`from`, unlike instid, is now compared: see
* test_dispatch_decisions_differing_from_timestamp_mismatch above). The
* ORIGINAL recording's counter may have been
* running, and building allocations, for far longer before this capture
* window started; a fresh replay's own counter starts whatever its loaded
* snapshot's nextid happens to be -- the two have no reason to reach the
* same value for "the same" dispatch, even when every other field is
* byte-for-byte identical. Uses two `instid` values matching a real
* captured .replay file's own observed divergence (826 vs 1) to prove this
* is deliberate exclusion, not a fluke of small numbers happening to
* coincide.
*/
static void test_dispatch_decisions_differing_instid_still_match(void)
{
xce_alloc_t* res_a[1]
= { make_test_alloc("mem", "", 826ULL, 307200.0, 100, -1) };
xce_host_alloc_t* host_a[1] = { make_test_host_alloc("hostA", res_a, 1) };
xce_job_alloc_t* expected_alloc = make_test_job_alloc(42, host_a, 1);
xce_alloc_t* res_b[1]
= { make_test_alloc("mem", "", 1ULL, 307200.0, 100, -1) };
xce_host_alloc_t* host_b[1] = { make_test_host_alloc("hostA", res_b, 1) };
xce_job_alloc_t* actual_alloc = make_test_job_alloc(42, host_b, 1);
replay_decision_t expected = make_replay_dispatch_decision(expected_alloc);
xce_decision_t* actual = make_dispatch_decision(actual_alloc);
TEST_ASSERT_TRUE(sim_decision_eq(&expected, actual, NULL));
printf("test_dispatch_decisions_differing_instid_still_match: PASS\n");
}
static void test_pend_decisions_with_identical_content_match(void)
{
replay_decision_t expected = make_replay_pend_decision(9001ULL, 3);
@ -2070,10 +1987,7 @@ int main(void)
RUN_TEST(test_dispatch_decisions_with_identical_content_match);
RUN_TEST(test_dispatch_decisions_differing_jobid_mismatch);
RUN_TEST(test_dispatch_decisions_differing_host_mismatch);
RUN_TEST(test_dispatch_decisions_differing_resource_value_mismatch);
RUN_TEST(test_dispatch_decisions_differing_from_timestamp_mismatch);
RUN_TEST(test_dispatch_decisions_differing_instid_still_match);
RUN_TEST(test_pend_decisions_with_identical_content_match);
RUN_TEST(test_pend_decisions_differing_jobid_mismatch);
RUN_TEST(test_pend_decisions_differing_main_reason_mismatch);