core1: use C repr in attribute writeback #357

Merged
sb10q merged 1 commits from srenblad/artiq-zynq:fix_attr_writeback into master 2025-02-06 20:13:26 +08:00
Collaborator

Rust reserves the right to reorder struct fields if the struct is repr(Rust). The Attr and Type structs come from the compiled kernel code, and they appear to have fixed ordering in the LLVM IR.

This is not a problem for our current Rust version, as the compiler is less aggressive with field reordering. I have noticed it becoming a problem when pushing the rustc version higher.

All HITL tests pass and there are no noticeable performance changes for test_performance.py.

Rust reserves the right to reorder struct fields if the struct is `repr(Rust)`. The `Attr` and `Type` structs come from the compiled kernel code, and they [appear](https://github.com/m-labs/artiq/blob/9558dd20e1cf3aa0afcaf1acf29202350c040cdc/artiq/compiler/transforms/llvm_ir_generator.py#L566-L570) to have fixed ordering in the LLVM IR. This is not a problem for our current Rust version, as the compiler is less aggressive with field reordering. I have noticed it becoming a problem when pushing the `rustc` version higher. All HITL tests pass and there are no noticeable performance changes for `test_performance.py`.
srenblad added 1 commit 2025-02-06 15:01:38 +08:00
sb10q merged commit 21a4a0b5dd into master 2025-02-06 20:13:26 +08:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/artiq-zynq#357
No description provided.