Files
Kevin Lenzo f13a2d4a16 Resolved: write the resolved config atomically to fix a parallel-shard crash
sync_runtime() regenerates etc/sphinx_train.resolved.json from every script
that loads SphinxTrain::Config, so the parallel comp_feat shards can enter
write_file() concurrently. It opened the target with ">", truncating it in
place and bumping its mtime; a sibling shard then judged the file fresh, read
it while still empty, and died "malformed JSON string ... (end of string)" at
BEGIN -- surfacing as "Parallel job failed with exit code 255" with no shard
log. This is the actual cause of the flaky train-g2p-lda-vtln / train-parallel
failures. Write a per-process temp file and rename() it over the target
(atomic on POSIX) so a concurrent reader always sees a complete file.
2026-08-16 20:09:12 -04:00
..