"""Build the solve request of a chained design from a run's answer: the history its coupling hands over. A coupling hands values from the run's recorded frames into the solve bit for bit: each frame's 32-bit slot widened exactly to 64 bits. The frame layout is in describe_card (frame_slots). This module reads the slots from frame_hex with the standard library and lays the history out the way a task states it. chained_solve(layout, parameters, run_request, run_answer) -> the solve's arguments, with from layout is the task's check.design.chain.layout: {"kind": "stardust_slab", "cool_to_s": 600.0} or {"kind": "triga_element"}. Licence: Apache-2.0. """ import copy import struct def _slots(run_answer, f64_at, f32_at): """Per recorded frame: the f64 at f64_at and each f32 at f32_at, widened.""" out = [[] for _ in range(1 + len(f32_at))] for frame in run_answer["frames"]: raw = bytes.fromhex(frame["frame_hex"]) out[0].append(struct.unpack("