10000 [Bug-App]: Exported PNG hides continuous zero-valued segments (horizontal line at 0 disappears) · Issue #9994 · wandb/wandb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Bug-App]: Exported PNG hides continuous zero-valued segments (horizontal line at 0 disappears) #9994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
songyuc opened this issue Jun 6, 2025 · 1 comment
Labels
a:app Area: Frontend/Backend ty:bug type of the issue is a bug

Comments

@songyuc
Copy link
songyuc commented Jun 6, 2025

Describe the bug

When a tracked metric (e.g., eval/success_once) remains exactly 0 for many consecutive steps, the WandB web UI correctly displays a thin horizontal line at Y=0. However, clicking Download PNG produces an image where that entire zero-valued segment is effectively “invisible” (it is compressed into the bottom of the plot or cropped out entirely), giving the impression that the curve abruptly ends rather than remaining at 0. This can confuse users into thinking their metric has stopped logging or that data is missing.

Image


Steps to Reproduce:

  1. Create a simple WandB run that logs a nonzero value for a while, then logs 0 continuously. For example:

    import wandb
    
    run = wandb.init(project="zero-line-bug-demo")
    for step in range(50_000_000):
        if step < 30_000_000:
            value = 1.0
        else:
            value = 0.0
        wandb.log({"eval/success_once": value}, step=step)
  2. In the WandB web interface, open the run and observe the plotted line:

    • From step 0 to 30 million, eval/success_once oscillates around 1.0 (or remains at 1.0 in this example).
    • After step 30 million, the metric is logged as 0.0 for all subsequent steps.
      You will see a thin horizontal line “stuck” at Y=0 in the browser chart.
  3. Click the Download PNG button in the top-right corner of the chart.

  4. Open the downloaded PNG file. Notice that the zero-valued segment is either compressed against the x-axis or not visible at all; it looks as if the curve abruptly disappeared at step 30 million rather than remaining at 0.


Expected Behavior:

  • The exported PNG should retain a visible horizontal line at Y=0 for all steps where the metric is exactly 0.
  • Ideally, WandB would automatically leave a small bottom‐margin (e.g., extend the y-axis lower bound slightly below 0) when it detects a long constant segment at 0, so that users can still see that the metric is holding at zero.
  • Alternatively, an option in the chart editor (e.g., “Always display zero baseline”) could ensure that a flat line at 0 is never cropped out in the exported image.

Actual Behavior:

  • In the web UI, the flat zero segment is visible (it is drawn as a thin line at Y=0).
  • In the downloaded PNG, that same segment is essentially “invisible” (compressed onto the x-axis or clipped), making it appear as if the metric disappeared instead of staying at zero.

Screenshots:

  1. Web UI view (zero segment visible):

Image

In the browser, you can see a thin line at Y=0 for steps > 30 million.

  1. Exported PNG (zero segment hidden):

Image

In the downloaded PNG, the flat line at Y=0 is not visible or is merged with the axis.


Environment:

  • Browser: Chrome 114.0.5735.199 (Ubuntu 20.04)
  • Operating System: Ubuntu 20.04 LTS

Additional Context:

  • This issue can mislead new users into thinking that their metric has stopped logging once it reaches 0, since the chart appears to “end.”
  • In many reinforcement‐learning environments or evaluation runs, a metric can plateau at 0 (e.g., “success rate” for an untrained policy). If the baseline disappears, it can cause confusion, especially when inspecting long training runs.
  • If WandB could detect “long constant segments” and automatically pad the y-axis by a small fraction (e.g., 5 pixels or 5% below the minimum value), that would solve the problem without requiring manual intervention.
  • Alternatively, adding a simple option in the chart editor like “Always show zero line” or “Include constant baselines” would allow users to opt in to preserving these flat 0 segments in their exports.

Thank you for considering this enhancement/bug fix. If you need any more details (e.g., a minimal reproduction script or raw CSV data), please let me know!

@songyuc songyuc added ty:bug type of the issue is a bug a:app Area: Frontend/Backend labels Jun 6, 2025
@fmamberti-wandb
Copy link
Contributor
fmamberti-wandb commented Jun 9, 2025

Hi @songyuc , thank you for raising this issue and providing all the details to reproduce on our end - I will raise this with our engineering team and will keep you posted.

In the meantime, as a workaround, you could manually set the y-axis Min to a value lower than 0, and the line will display in the exported png:

Image

On a side note, to make sure performance on your workspaces is not impacted I would suggest reducing the logging frequency for you metrics, as following our recommendations we suggest not to log more than 100k steps per metric (see here) and while this is not a hard-limit, having ~50M steps per metric could impact the workspace performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:app Area: Frontend/Backend ty:bug type of the issue is a bug
Projects
None yet
Development

No branches or pull requests

2 participants
0