@@ -1077,6 +1077,7 @@ int Run(bool hardware) {
10771077 const auto creates_before_drag = native::nr_features_created;
10781078 const auto * upper_before_edit = first_cache->tiers [0 ].state .slots [0 ].handle ;
10791079 const auto * lower_before_edit = native::features.at (ordinary_handle).slots [0 ].handle ;
1080+ const auto lower_model_before_edit = *reinterpret_cast <const uint32_t *>(lower_before_edit);
10801081 native::nr_adaptive_editing.store (true );
10811082 for (const float minimum : {.6f , .5f }) {
10821083 native::kSetAdaptiveMinScale .Store (minimum);
@@ -1092,9 +1093,19 @@ int Run(bool hardware) {
10921093 submit ();
10931094 }
10941095 auto revised_cache = native::features.at (ordinary_handle).adaptive_cache ;
1096+ const auto * lower_after_edit = revised_cache->tiers [2 ].state .slots [0 ].handle ;
1097+ Check (lower_after_edit != nullptr , " revised lower tuple owns a model" );
1098+ const auto lower_model_after_edit = *reinterpret_cast <const uint32_t *>(lower_after_edit);
1099+ std::cout << " TRACE ordinary-minimum-edit cache_retained=" << (revised_cache == first_cache)
1100+ << " upper_retained=" << (native::features.at (ordinary_handle).slots [0 ].handle == upper_before_edit)
1101+ << " lower_address_reused=" << (lower_after_edit == lower_before_edit)
1102+ << " lower_model_before=" << lower_model_before_edit << " lower_model_after=" << lower_model_after_edit
1103+ << " lower_width=" << revised_cache->ladder .sizes [2 ][0 ].width << ' \n ' ;
1104+ // Released mock handles may reuse their allocation; model IDs distinguish
1105+ // a new tuple from retaining the previous model at that address.
10951106 Check (revised_cache == first_cache && revised_cache->ladder .sizes [2 ][0 ].width == 8
10961107 && native::features.at (ordinary_handle).slots [0 ].handle == upper_before_edit
1097- && revised_cache-> tiers [ 2 ]. state . slots [ 0 ]. handle != lower_before_edit ,
1108+ && lower_model_after_edit != lower_model_before_edit ,
10981109 " minimum edits retain the compatible upper model and replace the incompatible lower tuple" );
10991110 native::PollAdaptiveCache (revised_cache.get ());
11001111 Check (revised_cache->tiers [2 ].ready , " new minimum is not ready until its own first-evaluate completion" );
0 commit comments