do not attach last successful filter to view state, since does not apply in all cases - fix artifact staleness default marker (if we do not get an artifact at all, then it is stale)

This commit is contained in:
Ryan Fleury
2025-10-07 12:09:14 -07:00
parent 0f0e36d40b
commit f60ccb60f1
3 changed files with 4 additions and 10 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ ac_artifact_from_key_(Access *access, String8 key, AC_ArtifactParams *params, U6
Stripe *stripe = stripe_from_slot_idx(&cache->stripes, slot_idx);
//- rjf: cache * key -> existing artifact
B32 artifact_is_stale = 0;
B32 artifact_is_stale = 1;
B32 got_artifact = 0;
B32 need_request = 0;
AC_Artifact artifact = {0};
-4
View File
@@ -230,10 +230,6 @@ struct RD_ViewState
U8 query_buffer[KB(1)];
U64 query_string_size;
// rjf: last successful query string state
U8 last_successful_query_buffer[KB(1)];
U64 last_successful_query_string_size;
// rjf: contents are focused (disables query focus)
B32 contents_are_focused;
};
+3 -5
View File
@@ -1650,20 +1650,18 @@ E_TYPE_EXPAND_INFO_FUNCTION_DEF(debug_info_table)
if(section != RDI_SectionKind_NULL)
{
U64 endt_us = rd_state->frame_eval_memread_endt_us;
U128 fuzzy_search_key = {d_hash_from_string(str8_struct(&rd_regs()->view)), (U64)section};
B32 stale = 0;
accel->section = section;
accel->items = di_search_item_array_from_target_query(rd_state->frame_access, section, filter, endt_us, &stale);
RD_ViewState *vs = rd_view_state_from_cfg(rd_cfg_from_id(rd_regs()->view));
RD_Cfg *last_successful_query_cfg = rd_immediate_cfg_from_keyf("last_successful_query_%I64x", rd_regs()->view);
if(stale)
{
String8 last_query = str8(vs->last_successful_query_buffer, vs->last_successful_query_string_size);
String8 last_query = last_successful_query_cfg->first->string;
accel->items = di_search_item_array_from_target_query(rd_state->frame_access, section, last_query, endt_us, 0);
}
else
{
vs->last_successful_query_string_size = Min(sizeof(vs->last_successful_query_buffer), filter.size);
MemoryCopy(vs->last_successful_query_buffer, filter.str, vs->last_successful_query_string_size);
rd_cfg_new_replace(last_successful_query_cfg, filter);
}
}