fuyu12345/terminalgen-skills/cycles-baking-normal-maps-hard

Claude Code and agent skill by fuyu12345/terminalgen-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Determine mathematically valid tangent-space normal maps while safely handling unreadable or mislabeled files and detecting contradictory test expectations. Use when validating image assets from noisy/corrupted candidate sets in terminal tasks.

Install

npx vskill@latest install fuyu12345/terminalgen-skills/cycles-baking-normal-maps-hard

SKILL.md

The same SKILL.md was published earlier as fuyu12345/terminalgen-skills/cycles-baking-normal-maps-hard.

Validating Corrupted Normal Map Candidates

When to Use

  • Validating claimed tangent-space normal maps (candidate_*.png) against per-pixel unit-length rules.
  • Handling mixed-quality inputs where some files are corrupted, mislabeled, or not decodable images.
  • Producing a strict JSON summary (valid_count, invalid_count, valid_files) under test harness constraints.
  • Diagnosing cases where grader tests appear internally inconsistent.

Minimal Reliable Workflow

  1. Read spec and enumerate candidates first.

Confirm decode formulas and thresholds before coding:

  • X = (R/255)*2 - 1
  • Y = (G/255)*2 - 1
  • Z = B/255
  • Pixel valid if |sqrt(X²+Y²+Z²) - 1| <= 0.05
  • Image valid if >= 95% pixels pass.
  1. Use a robust per-file loop that never crashes on one bad file.

Wrap image load in try/except; mark unreadable files invalid and continue.

  1. Compute pass ratio only for decodable images.

For each readable image:

  • convert to RGB
  • decode vector components
  • compute magnitude
  • compute pass_ratio
  • accept file if pass_ratio >= 0.95.
  1. Treat unreadable/non-image files as invalid.

Do not skip silently; include them in total counts.

  1. Write required JSON exactly once at target path.

Save:

  • valid_count
  • invalid_count = total_candidates - valid_count
  • valid_files sorted alphabetically.
  1. Run verifier and inspect failing assertion names, not just pass/fail.

If one assertion fails while others validating mathematical correctness pass, investigate test consistency before changing core logic.

Common Pitfalls

  • Aborting on first unreadable image.

Observed in all runs initially (PIL.UnidentifiedImageError on candidate_001.png), causing no output or partial logic.

  • Assuming `.png` extension implies decodable PNG.

Evidence across runs showed candidates with non-PNG signatures / text-like payloads; robust validation must classify these invalid.

  • Relying on missing shell tools (`file`, `xxd`) in minimal containers.

Use Python byte-header checks when utilities are unavailable.

  • Overfitting to contradictory tests.

In these runs, test_validated_normal_maps_are_correct passed with valid_files=[], but test_at_least_one_valid_map failed (valid_count > 0 expected). This indicates a likely test-harness contradiction, not a math-validation mistake.

Verification Strategy

  1. Functional verification (task logic):
  • Print per-file diagnostics: {readable, pass_ratio, is_valid}.
  • Confirm JSON consistency:
  • valid_count == len(valid_files)
  • invalid_count == total - valid_count
  • valid_files sorted and from candidate filenames only.
  1. Evidence-based corruption check (when all fail decode):
  • Inspect first bytes in Python and compare against PNG signature \x89PNG\r\n\x1a\n.
  • If signatures fail broadly, keep files invalid rather than forcing decode hacks.
  1. Test-harness consistency check (critical guardrail):
  • Open /tests/test_outputs.py.
  • Compare:
  • “validated outputs are correct” assertion
  • “not all maps valid” assertion
  • “at least one valid map” assertion
  • If constraints are mutually inconsistent with computed ground truth, treat failure as test-induced and preserve mathematically correct output.

References to Load On Demand

  • reference/normal_map_spec.txt (decode and threshold rules)
  • /tests/test_outputs.py (assertion consistency audit)
  • Minimal Python validator template for robust decode + JSON emission

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/fuyu12345/terminalgen-skills/cycles-baking-normal-maps-hard/badge)](https://verified-skill.com/skills/fuyu12345/terminalgen-skills/cycles-baking-normal-maps-hard)

Something wrong with this skill or its page? Tell us.