Skip to content

refactor: finalize dataset directory before media initialization #1056

Open

Description

@andreatnvidia

Priority Level

Low

Task Summary

Finalize the dataset directory after the resume decision and before initializing media storage. Give each run one final path so normal generation does not need to rewrite the cached dataset name or refresh media paths afterward.

Technical Details & Implementation Plan

  • Defer media storage initialization until the dataset directory is finalized.
  • Keep fresh-directory allocation atomic, including collisions on the base and timestamped names.
  • Preserve compatible resume, incompatible IF_POSSIBLE fallback, completed-run short-circuits, and previews that do not create dataset directories.
  • Simplify cached-name invalidation and media-path refresh where the revised lifecycle makes them unnecessary.
  • Cover fresh runs, resume decisions, concurrent allocation, image paths, and previews with regression tests.

Investigation / Context

Requested in Nabin's review comment, following the collision fix in #1051 for #1050.

ArtifactStorage.validate_folder_names() currently initializes MediaStorage using base_dataset_path, which resolves and caches the dataset name during construction. DatasetBuilder.build() later decides whether to resume or start fresh. Fresh-directory allocation can change the chosen name, requiring a cache rewrite and refresh_media_storage_path().

Dependencies

Follow-up to #1051. This refactor does not block that bug fix.

Activity

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

    taskInternal development task

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions