Fix test fixture lifetimes for sanitizer validation

Avoid empty-payload fwrite, retain the JSON embedding value during iteration, and release fake pinned allocations between Flash-Next redeclarations. Test-only fixes used by the HYV3 sanitizer run.
This commit is contained in:
Constantin authored and StillDeadcode committed 2026-10-25 12:09:29 +01:00
1 parent 91fc4192aa
commit a6702f8db5
3 files changed
+9 -4

No files matched your search

+5 -1
View File
@@ -9520,7 +9520,7 @@ TEST(flashnext_a_spanned_prefill_runs_a_pass_at_a_time_with_its_all_reduces_besi
ctx.max_mixed_tok = 2048;
REQUIRE_EQ(stderr_of_rc([&] { return qwen4exp_fp8::declare(&b, &meta, &ctx); }),
RAD_OK);
const qwen4exp_fp8::Model& m = qwen4exp_fp8::g_model[rank];
qwen4exp_fp8::Model& m = qwen4exp_fp8::g_model[rank];
CHECK(m.span_on);
CHECK_EQ(m.pipe_on, world > 2);
CHECK_EQ(m.qsacfg.plane_rows, 2048);
@@ -9556,6 +9556,10 @@ TEST(flashnext_a_spanned_prefill_runs_a_pass_at_a_time_with_its_all_reduces_besi
CHECK(score > 0);
CHECK_EQ(wide_score, 0);
CHECK(conv > 0);
/* This fake runtime has no engine teardown between model redeclarations. */
rad_dev_free(m.pipe_cu_h, RAD_MEM_HOST_PINNED);
m.pipe_cu_h = nullptr;
m.pipe_cu_tried = false;
if (world < 4) {
CHECK_EQ(ar, world > 1 ? 1 : 0);
CHECK_EQ(ar_lane0, ar);
+2 -1
View File
@@ -60,7 +60,8 @@ void write_shard(const std::string& path, const std::vector<T>& ts) {
const uint64_t n = hdr.size();
std::fwrite(&n, 8, 1, f);
std::fwrite(hdr.data(), 1, hdr.size(), f);
for (const T& t : ts) std::fwrite(t.bytes.data(), 1, t.bytes.size(), f);
for (const T& t : ts)
if (!t.bytes.empty()) std::fwrite(t.bytes.data(), 1, t.bytes.size(), f);
std::fclose(f);
}
+2 -2
View File
@@ -5143,8 +5143,8 @@ TEST(embeddings_are_truncated_then_normalised_and_failures_named) {
}
{
f.sched.embedding = std::vector<float>(8, 0.0f);
for (const json& x : vectors(R"({"input":"a"})")["data"][0]["embedding"])
CHECK_EQ(x.get<float>(), 0.0f);
const json embedding = vectors(R"({"input":"a"})")["data"][0]["embedding"];
for (const json& x : embedding) CHECK_EQ(x.get<float>(), 0.0f);
}
f.sched.embedding = { 3, 4, 0, 12, 0, 0, 0, 0 };
{