Michael Rabinovich Cursor commited on
Commit
e3a820e
·
1 Parent(s): 9368361

Publish all per-fixture renders (PNG views + rotating.webp)

Browse files

Upload each fixture's whole renders/ folder under
renders/<submission>/<fixture>/ instead of a single iso thumbnail.

Co-authored-by: Cursor <cursoragent@cursor.com>

Files changed (1) hide show
  1. eval_job.py +15 -19
eval_job.py CHANGED
@@ -82,14 +82,6 @@ SHARD_BUCKET_PREFIX_ENV = "CADGENBENCH_SHARD_BUCKET_PREFIX"
82
  # whole ``shards/`` tree after a successful merge.
83
  SHARDS_DIR_NAME = "shards"
84
 
85
- # Single canonical view uploaded per fixture for the leaderboard
86
- # gallery thumbnail. "iso" matches the GT render the gallery pairs it
87
- # with, so the gallery columns stay a comparable matrix at one fixed
88
- # camera angle. The evaluator writes this at
89
- # ``<run_dir>/<fixture>/renders/iso.png`` (cadgenbench DEFAULT_VIEWS).
90
- GALLERY_THUMB_VIEW = "iso"
91
-
92
-
93
  def main() -> int:
94
  parser = argparse.ArgumentParser(
95
  description="Run the CADGenBench eval pipeline on an HF Job.",
@@ -399,20 +391,20 @@ def _publish_reports_and_gallery(
399
  submissions_repo: str,
400
  token: str,
401
  ) -> None:
402
- """Publish report HTML/JSON + every gallery thumbnail in one commit.
403
 
404
- Stages ``reports/<id>.{html,json}`` plus one
405
- ``renders/<id>/<fixture>.png`` per fixture that produced an ``iso``
406
- thumbnail, then pushes them all in a single ``create_commit``. A
407
  commit-per-file both serialises the publish and hammers the
408
  dataset's commit endpoint (the 429 "concurrency queue" failures that
409
  stranded earlier runs); one commit is atomic, fast, and rate-limit
410
- friendly. The standalone PNGs back the gallery's ``renderFor()``; the
411
  full multi-view renders stay base64-embedded in ``reports/<id>.html``
412
- for the self-contained report. A fixture with no ``iso.png`` (missing
413
  output, or a render that never ran) is skipped; the gallery reads the
414
  per-fixture status from the row and draws the dashed "invalid
415
- generation" cell, so a thumbnail's absence is not an error.
416
  """
417
  operations: list[CommitOperationAdd] = [
418
  CommitOperationAdd(
@@ -428,15 +420,19 @@ def _publish_reports_and_gallery(
428
  ]
429
  render_count = 0
430
  for fixture_dir in sorted(d for d in run_dir.iterdir() if d.is_dir()):
431
- iso_png = fixture_dir / "renders" / f"{GALLERY_THUMB_VIEW}.png"
432
- if iso_png.is_file():
 
 
 
 
433
  operations.append(
434
  CommitOperationAdd(
435
  path_in_repo=(
436
  f"{RENDERS_DIR_IN_REPO}/{submission_id}/"
437
- f"{fixture_dir.name}.png"
438
  ),
439
- path_or_fileobj=str(iso_png),
440
  )
441
  )
442
  render_count += 1
 
82
  # whole ``shards/`` tree after a successful merge.
83
  SHARDS_DIR_NAME = "shards"
84
 
 
 
 
 
 
 
 
 
85
  def main() -> int:
86
  parser = argparse.ArgumentParser(
87
  description="Run the CADGenBench eval pipeline on an HF Job.",
 
391
  submissions_repo: str,
392
  token: str,
393
  ) -> None:
394
+ """Publish report HTML/JSON + every per-fixture gallery render in one commit.
395
 
396
+ Stages ``reports/<id>.{html,json}`` plus each fixture's render folder
397
+ under ``renders/<id>/<fixture>/`` (canonical PNG views and
398
+ ``rotating.webp``), then pushes them all in a single ``create_commit``. A
399
  commit-per-file both serialises the publish and hammers the
400
  dataset's commit endpoint (the 429 "concurrency queue" failures that
401
  stranded earlier runs); one commit is atomic, fast, and rate-limit
402
+ friendly. The standalone GIFs back the gallery's ``renderFor()``; the
403
  full multi-view renders stay base64-embedded in ``reports/<id>.html``
404
+ for the self-contained report. A fixture with no render folder (missing
405
  output, or a render that never ran) is skipped; the gallery reads the
406
  per-fixture status from the row and draws the dashed "invalid
407
+ generation" cell, so a render artifact's absence is not an error.
408
  """
409
  operations: list[CommitOperationAdd] = [
410
  CommitOperationAdd(
 
420
  ]
421
  render_count = 0
422
  for fixture_dir in sorted(d for d in run_dir.iterdir() if d.is_dir()):
423
+ renders_dir = fixture_dir / "renders"
424
+ if not renders_dir.is_dir():
425
+ continue
426
+ for render_path in sorted(renders_dir.iterdir()):
427
+ if render_path.suffix.lower() not in {".png", ".webp"}:
428
+ continue
429
  operations.append(
430
  CommitOperationAdd(
431
  path_in_repo=(
432
  f"{RENDERS_DIR_IN_REPO}/{submission_id}/"
433
+ f"{fixture_dir.name}/{render_path.name}"
434
  ),
435
+ path_or_fileobj=str(render_path),
436
  )
437
  )
438
  render_count += 1