further debugging / logging / work on tester, trynig to get to the bottom of nondeterministic rdi generation

This commit is contained in:
Ryan Fleury
2024-10-15 17:41:18 -07:00
parent 65b5176468
commit 4671458e8e
7 changed files with 177 additions and 22 deletions
+112 -3
View File
@@ -4488,7 +4488,7 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
}
// rjf: UDTs
ProfScope("kick off udts string map build tasks")
if(0) ProfScope("kick off udts string map build tasks")
{
U64 items_per_task = 4096;
U64 num_tasks = (in_params->udts.total_count+items_per_task-1)/items_per_task;
@@ -4520,7 +4520,7 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
}
// rjf: symbols
ProfScope("kick off symbols string map build tasks")
if(0) ProfScope("kick off symbols string map build tasks")
{
RDIM_SymbolChunkList *symbol_lists[] =
{
@@ -4561,7 +4561,7 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
}
// rjf: scope chunks
ProfScope("kick off scope chunks string map build tasks")
if(0) ProfScope("kick off scope chunks string map build tasks")
{
U64 items_per_task = 4096;
U64 num_tasks = (in_params->scopes.total_count+items_per_task-1)/items_per_task;
@@ -4618,6 +4618,38 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
}
}
//////////////////////////////
//- rjf: [DEBUG] dump unsorted *per-thread* loose string maps
//
#if 0
{
U64 slots_count = bake_string_map_topology.slots_count;
RDIM_BakeStringMapLoose **maps = bake_string_maps__in_progress;
U64 maps_count = ts_thread_count();
for EachIndex(map_idx, maps_count)
{
RDIM_BakeStringMapLoose *map = maps[map_idx];
if(map && map->slots != 0)
{
for EachIndex(slot_idx, slots_count)
{
RDIM_BakeStringChunkList *slot = map->slots[slot_idx];
if(slot != 0)
{
for(RDIM_BakeStringChunkNode *n = slot->first; n != 0; n = n->next)
{
for EachIndex(idx, n->count)
{
printf("string: %.*s\n", str8_varg(n->v[idx].string));
}
}
}
}
}
}
}
#endif
//////////////////////////////
//- rjf: produce joined string map
//
@@ -4653,6 +4685,35 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
rdim_bake_string_map_loose_push_path_tree(arena, &bake_string_map_topology, unsorted_bake_string_map, path_tree);
}
//////////////////////////////
//- rjf: [DEBUG] dump unsorted *joined* loose string map
//
#if 0
{
U64 string_idx = 0;
U64 slots_count = bake_string_map_topology.slots_count;
RDIM_BakeStringMapLoose *map = unsorted_bake_string_map;
if(map && map->slots != 0)
{
for EachIndex(slot_idx, slots_count)
{
RDIM_BakeStringChunkList *slot = map->slots[slot_idx];
if(slot != 0)
{
for(RDIM_BakeStringChunkNode *n = slot->first; n != 0; n = n->next)
{
for EachIndex(idx, n->count)
{
printf("string: %.*s\n", str8_varg(n->v[idx].string));
string_idx += 1;
}
}
}
}
}
}
#endif
//////////////////////////////
//- rjf: kick off string map sorting tasks
//
@@ -4691,6 +4752,35 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
}
RDIM_BakeStringMapLoose *sorted_bake_string_map = sorted_bake_string_map__in_progress;
//////////////////////////////
//- rjf: [DEBUG] dump sorted, joined loose string map
//
#if 0
{
U64 string_idx = 0;
U64 slots_count = bake_string_map_topology.slots_count;
RDIM_BakeStringMapLoose *map = sorted_bake_string_map;
if(map && map->slots != 0)
{
for EachIndex(slot_idx, slots_count)
{
RDIM_BakeStringChunkList *slot = map->slots[slot_idx];
if(slot != 0)
{
for(RDIM_BakeStringChunkNode *n = slot->first; n != 0; n = n->next)
{
for EachIndex(idx, n->count)
{
printf("string: %.*s\n", str8_varg(n->v[idx].string));
string_idx += 1;
}
}
}
}
}
}
#endif
//////////////////////////////
//- rjf: build finalized string map
//
@@ -4701,6 +4791,25 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
RDIM_BakeStringMapTight bake_strings = rdim_bake_string_map_tight_from_loose(arena, &bake_string_map_topology, &bake_string_map_base_idxes, sorted_bake_string_map);
ProfEnd();
//////////////////////////////
//- rjf: [DEBUG] dump sorted, joined tight string map
//
#if 0
{
for EachIndex(slot_idx, bake_strings.slots_count)
{
RDIM_BakeStringChunkList *slot = &bake_strings.slots[slot_idx];
for(RDIM_BakeStringChunkNode *n = slot->first; n != 0; n = n->next)
{
for EachIndex(idx, n->count)
{
printf("string: %.*s\n", str8_varg(n->v[idx].string));
}
}
}
}
#endif
//////////////////////////////
//- rjf: kick off pass 2 tasks
//