Skip to content

Angular graph rendering depends on hash map iteration order (fails on 32-bit) #195

Closed

Description

@qaqland

Serie 0.10.0 on a 32-bit arch (Alpine x86, armv7, armhf) fails two snapshot tests:

failures:
---- graph::image::tests::test_calc_graph_row_image_color::case_2::antialias_1_false stdout ----
thread 'graph::image::tests::test_calc_graph_row_image_color::case_2::antialias_1_false' (4196) panicked at src/graph/image.rs:1576:39:
Images are different. diff: ./out/ut/graph/image/color_angular_diff.png
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- graph::tests::complex_002 stdout ----
thread 'graph::tests::complex_002' (4800) panicked at src/graph/tests/snapshot.rs:76:9:
Images are different. diff: ./out/graph/complex_002_angular_diff.png
Images are different. diff: ./out/graph/complex_002_angular_single_diff.png
failures:
    graph::image::tests::test_calc_graph_row_image_color::case_2::antialias_1_false
    graph::tests::complex_002
test result: FAILED. 249 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 36.10s
error: test failed, to rerun pass `--bin serie`

Maybe we can use BTreeMap instead of FxHashMap for iteration:

serie/src/graph/image.rs

Lines 736 to 745 in 98363d0

let mut horizontal_edges_map: FxHashMap<usize, Vec<&Edge>> = FxHashMap::default();
for edge in horizontal_edges {
horizontal_edges_map
.entry(edge.associated_line_pos_x)
.or_default()
.push(edge);
}
for edges in horizontal_edges_map.values() {
draw_diagonal_connected_edge(&mut img_buf, edges, image_params, drawing_pixels);
}

Activity

  1. added
    bug
    on Oct 24, 2026
  2. lusingander commented on Oct 25, 2026

    @lusingander
    Owner

    Thank you for the report.

    As you mentioned, it appears that issues were occurring due to different hash calculation values in the 32-bit environment.
    I thought it would be appropriate to explicitly specify the order in which graphs are drawn, so I have made modifications accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions