Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问clear审计通过

path-tracing-reverse反向路径追踪

Agent Skill

path-tracing-reverse 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

815

周安装

35

GitHub Stars

93

下载量

286
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:path-tracing-reverse(反向路径追踪)
来源仓库:https://github.com/letta-ai/skills
仓库路径:skills/path-tracing-reverse
安装命令:
npx skills add https://github.com/letta-ai/skills --skill path-tracing-reverse
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/letta-ai/skills --skill path-tracing-reverse

简介

用于查找、检索和筛选相关信息。path-tracing-reverse 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

  • 适合在反向技术溯源或依赖分析中获取资料。
  • 通过 GitHub 安装,兼容多个 AI 工具链。
  • 建议确认原始 README 以了解具体用法。
  • 注意权限范围和潜在的文件读写行为。

SKILL.md

Path Tracing Reverse Engineering

Overview

This skill provides a systematic approach to reverse engineering graphics rendering binaries (ray tracers, path tracers, renderers) with high-fidelity output matching requirements. The primary challenge is achieving pixel-perfect or near-pixel-perfect reproduction (>99% similarity), which requires precise extraction of algorithms, constants, and rendering parameters rather than approximation.

Critical Success Factors

When high similarity thresholds (>99%) are required:

  1. Exact constant extraction is mandatory - Guessing or approximating floating-point values will fail
  2. Complete algorithm reconstruction - Partial understanding leads to systematic errors across large pixel regions
  3. Component isolation - Each rendering component (sky, ground, objects, lighting) must be verified independently
  4. Binary comparison strategy - Identify exactly which pixels differ and trace differences to specific algorithm components

Systematic Approach

Phase 1: Initial Analysis and Output Characterization

Before examining the binary internals:

  1. Run the program and capture output - Determine image dimensions, format (PPM, PNG, etc.), and general content
  2. Analyze the output image systematically:

- Sample pixels at regular intervals across the entire image - Identify distinct regions (sky, ground, objects, shadows) - Note color distributions and transitions - Map out approximate boundaries between rendering components

  1. Extract string information - Use strings to find function names, file paths, and embedded text that hints at the algorithm

Phase 2: Comprehensive Constant Extraction

Extract ALL floating-point constants before writing any code:

  1. Dump the rodata section - objdump -s -j.rodata binary or readelf -x.rodata binary
  2. Identify float patterns - Look for 4-byte sequences that decode to reasonable float values (0.0-1.0 for colors, larger values for positions)
  3. Create a constant map - Document every extracted constant with its address
  4. Cross-reference with disassembly - Determine which function uses each constant

Example extraction approach:

# Dump rodata and decode floats
objdump -s -j .rodata binary | grep -E "^\s+[0-9a-f]+" | while read addr data; do
    # Parse and decode 4-byte float sequences
done

Phase 3: Function-by-Function Reverse Engineering

Identify and completely reverse engineer each function:

  1. List all functions - Use nm or objdump -t to identify symbols
  2. Map the call graph - Understand which functions call which
  3. Prioritize rendering functions - Focus on functions like:

- sphere_intersect, ray_intersect (geometry intersection) - vector_normalize, vector_dot, vector_cross (math utilities) - shade, illuminate, reflect (lighting calculations) - trace, cast_ray (main rendering loop)

  1. Translate each function to pseudocode - Do not skip to implementation until each function is fully understood

Phase 4: Component-by-Component Implementation

Implement and verify each component separately:

  1. Start with the simplest component - Usually the sky/background gradient
  2. Verify against the original output before moving to the next component
  3. Test intersection routines independently - Create test cases that verify geometry calculations
  4. Add lighting last - Lighting errors compound with geometry errors

Phase 5: Binary Comparison and Debugging

When output doesn't match:

  1. Compute per-pixel differences - Create a difference map showing exact deviations
  2. Identify systematic vs. random errors:

- Systematic errors in one region = algorithm error for that component - Off-by-one patterns = rounding or precision difference - Color tint across objects = lighting model error

  1. Trace errors to specific constants or formulas - A wrong constant produces predictable error patterns

Common Pitfalls

Pitfall 1: Trial-and-Error Constant Adjustment

Problem: Making small adjustments to constants (0.747 → 0.690) based on visual comparison without understanding why values differ.

Solution: Extract exact constants from the binary. If a value doesn't match expectations, re-examine the disassembly rather than guessing.

Pitfall 2: Premature Implementation

Problem: Starting to write code before fully understanding the algorithm leads to incorrect assumptions being baked in.

Solution: Complete Phase 3 (full function reverse engineering) before writing implementation code.

Pitfall 3: Focusing on Easy Components While Ignoring Hard Ones

Problem: Spending effort perfecting the sky gradient (simple) while the sphere rendering (complex) remains completely wrong.

Solution: Identify all components early and allocate effort proportionally. A perfect sky with a broken sphere still fails similarity thresholds.

Pitfall 4: Assuming Simple Lighting Models

Problem: Assuming diffuse-only lighting when the binary uses more complex materials (specular, reflection, subsurface).

Solution: Analyze object colors carefully. Unexpected color tints (e.g., red tint on sphere: (51, 10, 10) vs expected gray) indicate material properties not accounted for.

Pitfall 5: Incomplete Scene Analysis

Problem: Missing objects in the scene due to incomplete analysis. Multiple gray values in color distribution may indicate multiple spheres.

Solution: Systematically analyze the entire output image. Count distinct object regions and verify each is accounted for.

Pitfall 6: Abandoning Disassembly Analysis

Problem: Starting disassembly of key functions but not following through to complete understanding.

Solution: For each identified function, create complete pseudocode before moving on. Mark functions as "fully understood" or "needs more analysis."

Verification Strategies

Strategy 1: Ground Truth Pixel Sampling

Sample specific pixels from the original output and verify the implementation produces identical values:

# Test critical pixels across different components
test_pixels = [
    (0, 0),      # Corner - likely sky
    (400, 0),    # Top center - sky
    (400, 500),  # Bottom center - ground
    (400, 300),  # Center - likely object
]
for x, y in test_pixels:
    original = get_pixel(original_image, x, y)
    generated = get_pixel(generated_image, x, y)
    assert original == generated, f"Mismatch at ({x},{y}): {original} vs {generated}"

Strategy 2: Component Isolation Testing

Test each rendering component in isolation by masking other components:

  1. Sky-only test: Verify pixels in regions with no objects
  2. Ground-only test: Verify checkerboard or ground pattern without objects
  3. Object-only test: Compare pixels within object boundaries

Strategy 3: Difference Image Analysis

Generate a visual difference image to identify error patterns:

# Per-pixel absolute difference
diff_image = abs(original - generated)
# Highlight pixels exceeding threshold
error_mask = diff_image > threshold

Strategy 4: Statistical Comparison

Track multiple similarity metrics:

  • Exact pixel match percentage - Should be very high (>95%) for success
  • Mean absolute error - Identifies average deviation
  • Max error - Identifies worst-case pixels for debugging
  • Cosine similarity - Overall structural similarity (but can mask localized errors)

Ray Tracing Specific Knowledge

Common Ray Tracer Structure

Most simple ray tracers follow this pattern:

for each pixel (x, y):
    ray = generate_ray(camera, x, y)
    color = trace_ray(ray, scene, depth)
    write_pixel(x, y, color)

trace_ray(ray, scene, depth):
    hit = find_closest_intersection(ray, scene)
    if no hit:
        return background_color(ray)
    return shade(hit, ray, scene, depth)

Key Constants to Extract

  • Image dimensions: Width, height (often in rodata or hardcoded)
  • Camera parameters: FOV, position, look-at direction
  • Object definitions: Sphere centers, radii, colors/materials
  • Light positions: Point light locations, colors, intensities
  • Material properties: Diffuse/specular coefficients, shininess

Floating-Point Precision

  • Binary may use float (32-bit) or double (64-bit)
  • Check instruction suffixes in x86: movss/addss for float, movsd/addsd for double
  • Ensure implementation uses same precision as original

Workflow Summary

  1. Characterize output - Dimensions, format, visual content
  2. Extract all constants - Complete rodata analysis
  3. Map all functions - Names, purposes, call relationships
  4. Reverse each function - Full pseudocode translation
  5. Implement by component - With verification at each step
  6. Binary comparison - Identify and fix remaining discrepancies
  7. Iterate - Use difference analysis to guide fixes

Avoid: Premature coding, constant guessing, partial function analysis, ignoring complex components.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.28%
按下载量换算84

Gemini CLI

19.44%
按下载量换算56

Codex

18.11%
按下载量换算52

Antigravity

13.39%
按下载量换算38

OpenCode

8.2%
按下载量换算23

windsurf

3.64%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills