Spaces:
Running
Running
Commit History
-
Add dyad_mode, and make condition assignment survive a restart
SONA participants bring their own ids and can quit and restart at will. If a restart reassigns them, the counterbalancing is destroyed silently. The PsychoPy tasks solved this with the Pavlovia shelf: a persistent orderMap keyed by subject id, looked up before assigning anything new. Do it with determinism instead of shared state -- assignment is a pure function of the pid, so a reload, a refresh or a Space cold start all land on the same arm. Nothing is claimed, so there is no race between simultaneous arrivals and no counter to lose. This is the same reason _seed_from_pid had to stop using hash(). Two sources: allocation.csv for the planned study, where the split is exactly balanced because it was dealt in advance, and a hash of the id for ids that were never in the table, where balance is approximate as it is for any per-arrival randomisation. Ids outside the table do NOT pick up a night block from their hash unless the link asks, so a pilot link cannot silently acquire one. dyad_…1f942d5