Now update the S2 phase to save sorted pairs into `data.sorted_way_cells`:


3023:                sorted_way_pairs = concat_and_sort(way_pairs);
3024:                build_cell_map(sorted_way_pairs, data.cell_to_ways);


Edit

                sorted_way_pairs = concat_and_sort(way_pairs);
                build_cell_map(sorted_way_pairs, data.cell_to_ways);

                sorted_way_pairs = concat_and_sort(way_pairs);
                // Keep sorted pairs for direct entry writing (skip hash map in write phase)
                data.sorted_way_cells = sorted_way_pairs;
                // Still need hash map for sorted_geo_cells union construction
                build_cell_map(sorted_way_pairs, data.cell_to_ways);