Skip to content

Commit fe64387

Browse files
authored
Merge branch 'main' into main
2 parents a70a641 + 50ee282 commit fe64387

370 files changed

Lines changed: 55299 additions & 364 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/AGENTS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# AGENTS: RenoDX skill authoring
2+
3+
This folder contains project-local workflow skills. Keep skills focused, discoverable, and useful for agents that may not have prior RenoDX context.
4+
5+
## Skill frontmatter
6+
7+
- Each skill must use `SKILL.md` under `.agents/skills/<skill-name>/`.
8+
- Keep `name` identical to the folder name.
9+
- Quote `description` values, especially when they contain colons, commas, or trigger phrases.
10+
- Treat `description` as the discovery surface: include the concrete words a user or agent will mention.
11+
- Keep `argument-hint` short and focused on the minimum context needed to start the workflow.
12+
13+
## Bundled resources
14+
15+
- Skill folders may include `templates/`, `snippets/`, `scripts/`, `references/`, or other small support files.
16+
- Reference any bundled file from `SKILL.md` with a relative Markdown link; agents load skill resources progressively and may not discover unreferenced files.
17+
- Prefer small templates and snippets that remove repeated scratch scaffolds or copy-paste shader boilerplate.
18+
- Do not bundle large captures, generated plots, game dumps, binaries, or one-off investigation artifacts.
19+
- Keep snippets clearly marked as starting points, not copy-paste replacements for game-specific proof.
20+
21+
## Scope and overlap
22+
23+
- Keep always-on repository rules in root or nested `AGENTS.md`; keep task-specific procedures in skills.
24+
- Start each broad skill with a short boundary or related-skills section when overlap is likely.
25+
- Prefer handoff language over duplication when another skill owns the next step.
26+
- Do not turn skills into scratch logs; move only stable workflow guidance into committed skill files.
27+
28+
## RenoDX-specific expectations
29+
30+
- Preserve the RenoDX distinction between upstream HDR/source recovery and final-frame inverse-tonemap postprocessing.
31+
- Treat RenoDX mods as neutral by default: preserve vanilla/original SDR contrast, saturation, hue, and grade while extending proven range/resource limits into HDR. Default settings should match the original as closely as practical; visual augmentation belongs in explicit sliders or presets such as `HDR Look`. Do not bake in "HDR = more contrast/saturation" looks.
32+
- For swapchain/resource work, keep `SwapChainPass`, proxy resources, output presets, color-space synchronization, and UI/HUD separation together.
33+
- For shader math, require a proven target pass/resource before applying tonemap, LUT, hard-clip, or HDR bridge guidance.
34+
- For analysis images and plots, keep source data and scripts reproducible and prefer dark-theme output.
35+
36+
## Maintenance checks
37+
38+
- After editing skills, validate Markdown diagnostics for the changed files.
39+
- Check that new trigger phrases are in the relevant `description`, not only in the body.
40+
- Keep `.agents/skills/README.md` in sync when adding, removing, or substantially changing a skill.

.agents/skills/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# RenoDX Workflow Skills
2+
3+
This folder contains project-local workflow skills for AI agents and contributors. Skills are on-demand procedures: use them when a task matches their domain instead of putting every workflow detail in always-on instructions.
4+
5+
RenoDX keeps shared workflow skills under `.agents/skills/` for the tool-neutral Agent Skills convention.
6+
7+
Default RenoDX mod behavior should be neutral: preserve the vanilla/original SDR art direction and extend its proven pipeline limits into HDR. Default settings should match the original look as closely as practical; visual augmentation belongs in explicit sliders or presets such as `HDR Look`, not in the baseline. Do not assume HDR means more contrast, more saturation, or a new look.
8+
9+
## How to use
10+
11+
- Agents: match the request to the table below, read the relevant `SKILL.md`, then follow its boundaries and handoffs.
12+
- Users: mention the skill name or trigger terms in chat when you want a specific RenoDX workflow.
13+
- Keep `AGENTS.md` for always-on repository rules; keep skills for specialized multi-step work.
14+
15+
## Skill index
16+
17+
| Skill | Use when | Handoff boundary |
18+
|---|---|---|
19+
| `setup-game-mod-dev` | Starting or resuming a game mod, setting up DevKit, configuring build targets, linking into a game folder, or creating baseline verification. | Hand off to `swapchain-resource-analysis` for resource/output proof and to `handle-sdr-tonemap-lut` for proven shader math. |
20+
| `swapchain-resource-analysis` | Tracing final output, swapchain formats, render resources, `SwapChainPass`, proxy resources, SDR/HDR toggles, or proving whether scene HDR data still exists. | Hand off to `setup-game-mod-dev` for addon wiring/builds and to `handle-sdr-tonemap-lut` after the shader-side target signal is proven. |
21+
| `handle-sdr-tonemap-lut` | Editing shader-side tonemap, hard clip, LUT/color grade, RenoDRT, vanilla/0 `ToneMapPass`, Preset Off vanilla reset, PsychoV, gamut compression, hue/saturation clip emulation, or HDR bridge logic after upstream signals are known. | Hand off to `swapchain-resource-analysis` if the target pass/resource or source signal is not proven. |
22+
| `analysis-graphing` | Creating dark-theme plots, curve comparisons, hue sweeps, gamut comparisons, LUT statistics, or image diagnostic panels. | Hand off to `hdr-test-pattern-generation` for source pattern generation and to `bt2020-png-generation` for final HDR PNG output. |
23+
| `hdr-test-pattern-generation` | Generating deterministic SDR/HDR ramps, charts, sweeps, color bars, checkerboards, gamut stress images, or validation sources. | Hand off to `analysis-graphing` for plotting results and to `bt2020-png-generation` for PQ PNG encoding/signaling. |
24+
| `bt2020-png-generation` | Producing or validating BT.2020/BT.2100 PQ PNGs, cICP chunks, ICC/cicpTag behavior, or HDR PNG artifacts from analysis data. | Hand off to `hdr-test-pattern-generation` for synthetic sources and to `analysis-graphing` for plots. |
25+
26+
## Maintenance notes
27+
28+
- The `description` field in each `SKILL.md` is the discovery surface. Put important trigger phrases there.
29+
- Skill folders may include referenced templates, snippets, scripts, and resources; link them from `SKILL.md` so agents can load them when needed.
30+
- Keep overlapping skills connected by explicit handoff text instead of copying the same procedure into multiple files.
31+
- Keep examples tied to stable RenoDX concepts or committed project patterns.
32+
- Validate changed Markdown files before committing.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
name: analysis-graphing
3+
description: "RenoDX workflow for creating readable analysis graphs and plots from shader math, CSVs, EXRs, LUTs, hue sweeps, tone curves, gamut comparisons, energy/scalar maps, and test-pattern statistics. Use when graphing, plotting, visualizing, comparing curves, making dark-theme matplotlib figures, or avoiding repeated one-off plot scripts."
4+
argument-hint: "data source, variables to compare, output path, units/axis scale, and whether the graph is scratch or durable"
5+
---
6+
7+
# RenoDX Analysis Graphing
8+
9+
Use this small skill for **plots and graphs**. Larger skills should call this out instead of embedding graphing rules.
10+
11+
## Boundaries
12+
13+
- Focus on visualizing data, not generating source test images or editing shaders.
14+
- Keep one-off plots and source scripts in a scratch output path unless the graph becomes a durable analysis artifact.
15+
- Promote repeated graph workflows into `tools/analysis/` with the data export beside the image.
16+
- Prefer `matplotlib` for Python analysis unless an existing script in the same workflow already uses another plotting library.
17+
- Use `bt2020-png-generation` for final HDR PQ PNG writing and signaling.
18+
- Use `hdr-test-pattern-generation` for ramps, sweeps, charts, and synthetic image inputs.
19+
20+
## Default style
21+
22+
- Use a dark theme by default: `plt.style.use("dark_background")`.
23+
- Save readable static images: usually PNG at `dpi=150` to `180`.
24+
- Choose figure sizes for labels first, not minimum pixels; common overview plots are `14x9`, `16x11`, or `17x11` inches.
25+
- Close figures after saving to avoid leaking state in batch scripts.
26+
- If the graph will be inspected in an issue or PR, prefer a single self-contained overview image plus any focused split images.
27+
28+
## Plot checklist
29+
30+
For every generated graph, make the output self-describing:
31+
32+
- Title states the experiment and transform/version being compared.
33+
- Axes include units: nits, linear RGB, PQ code value, hue degrees, stops, frame index, etc.
34+
- Legends use stable method names matching CSV column names or shader function names.
35+
- Include reference lines for anchors such as zero, diffuse white, mid-gray, `1.0`, peak nits, or gamut boundary when relevant.
36+
- Do not normalize silently. If data is normalized, show the normalization factor in the title, label, or CSV.
37+
- Use log/stops axes only when the labels make the scale obvious.
38+
- Save the plotted source data as CSV when values are generated rather than loaded from an existing CSV.
39+
40+
## Common RenoDX graph types
41+
42+
| Graph type | Use for | Notes |
43+
|---|---|---|
44+
| Tone/inverse diagnostic curve | Vanilla vs RenoDRT/PsychoV/ACES matching | Mark diffuse white, mid-gray, peak, and shoulder anchors; inverse plots are for fitting/diagnosis, not final-frame inverse-tonemap strategy. |
45+
| Gain/loss or delta plot | Comparing old/new math or fitted curves | Plot absolute output and error/delta, not only one. |
46+
| Hue sweep | Gamut compression, hue preservation, negative-channel checks | Hue degrees on x-axis; include min/max channel or perceptual metric. |
47+
| Gamut scatter / chip grid | BT.709, BT.2020, AP1/AP0 comparisons | State source gamut and adaptation path. |
48+
| LUT/stat overview | LUT pair comparisons, channel summaries, error histograms | Keep CSV summaries beside the graph. |
49+
| Image diagnostic panel | EXR/test-pattern before/after comparisons | Use fixed scales when comparing panels. |
50+
51+
## Existing examples
52+
53+
- [Dark plot template](./templates/dark_plot.py) for a minimal reusable matplotlib setup.
54+
- `tools/analysis/plot_cp2077_*` for readable dark-theme multi-panel graphs.
55+
- `tools/analysis/validate_mb_compress.py` for hue sweep validation and CSV-plus-plot output.
56+
- scratch `zelda_*` curve and derivative plots.
57+
58+
## Common mistakes to avoid
59+
60+
- Do not output light-theme graphs unless the user explicitly requests that style.
61+
- Do not crop legends, tick labels, or colorbars; use `tight_layout()` or explicit layout spacing.
62+
- Do not mix scene-linear, display-linear nits, and encoded PQ values on one axis without clear labels.
63+
- Do not present a graph without preserving the script or source CSV needed to reproduce it.
64+
- Do not keep copying a repeated plotting scaffold across scratch scripts; promote the pattern when it recurs.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"""Minimal RenoDX dark-theme matplotlib template.
2+
3+
Copy this into a scratch experiment or promote it into `tools/analysis/` when the
4+
plot workflow becomes durable. Keep generated source data beside the image.
5+
"""
6+
7+
from pathlib import Path
8+
9+
import matplotlib.pyplot as plt
10+
11+
12+
def configure_dark_plot() -> None:
13+
plt.style.use("dark_background")
14+
plt.rcParams.update(
15+
{
16+
"figure.dpi": 150,
17+
"savefig.dpi": 170,
18+
"axes.grid": True,
19+
"grid.alpha": 0.22,
20+
"legend.framealpha": 0.85,
21+
}
22+
)
23+
24+
25+
def save_figure(fig: plt.Figure, output_path: str | Path) -> None:
26+
output_path = Path(output_path)
27+
output_path.parent.mkdir(parents=True, exist_ok=True)
28+
fig.tight_layout()
29+
fig.savefig(output_path)
30+
plt.close(fig)
31+
32+
33+
def example_plot(output_path: str | Path) -> None:
34+
configure_dark_plot()
35+
fig, ax = plt.subplots(figsize=(14, 9))
36+
x = [0, 0.18, 1, 4, 8]
37+
y = [0, 0.18, 1, 2, 3]
38+
ax.plot(x, y, label="candidate")
39+
ax.axvline(1, color="white", alpha=0.35, linestyle="--", label="diffuse white")
40+
ax.set_title("RenoDX comparison: replace with experiment name")
41+
ax.set_xlabel("Scene-linear input relative to diffuse white")
42+
ax.set_ylabel("Display-linear output relative to diffuse white")
43+
ax.legend()
44+
save_figure(fig, output_path)
45+
46+
47+
if __name__ == "__main__":
48+
example_plot(Path("scratch_outputs") / "renodx_dark_plot_example.png")

0 commit comments

Comments
 (0)