Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
576603a
Vulkan Pipeline: HDR, Post-Processing, FXAA, and Bloom (Phase 2 & 3) …
MichaelFisher1997 Jan 24, 2026
4be4978
Phase 4: Optimization & Polish - GPU Profiling & Preset Tuning (#219)
MichaelFisher1997 Jan 24, 2026
5cf4f35
fix: final visual polish and LOD integration fixes for issue #201
MichaelFisher1997 Jan 25, 2026
a37196f
Visual Polish: Smooth LOD Transitions, AO Smoothing, and Grid-Free Te…
MichaelFisher1997 Jan 25, 2026
e240ab3
Merge main into dev and resolve conflicts by keeping dev's latest ren…
MichaelFisher1997 Jan 25, 2026
9984a16
Refactor: Relocate drawDebugShadowMap to Debug Overlay System (#227)
MichaelFisher1997 Jan 25, 2026
67100fb
Refactor: Relocate computeSSAO to SSAOSystem (#228)
MichaelFisher1997 Jan 25, 2026
b15c024
fix: harden Bloom/FXAA systems and clean up technical debt identified…
MichaelFisher1997 Jan 25, 2026
f4f6172
fix: address code review feedback for Bloom/FXAA systems and RHI tech…
MichaelFisher1997 Jan 25, 2026
0f27b96
fix: address all remaining code review feedback for memory safety and…
MichaelFisher1997 Jan 26, 2026
7cee2d8
fix(test): update mock RHI vtable to include missing fields for issue…
MichaelFisher1997 Jan 26, 2026
95a6509
fix: PBR lighting energy conservation (#230)
MichaelFisher1997 Jan 26, 2026
bdc295e
Merge main into dev and resolve PBR conflicts
MichaelFisher1997 Jan 26, 2026
8ad74ee
polish: remove HUD notification for energy conservation
MichaelFisher1997 Jan 26, 2026
66d6911
fix: resolve duplicate G key toggle causing shadow debug to fail
MichaelFisher1997 Jan 26, 2026
1bad10f
refactor: address PR review feedback for PBR lighting fixes
MichaelFisher1997 Jan 26, 2026
73a6c7a
refactor: address code review feedback for PBR lighting energy conser…
MichaelFisher1997 Jan 26, 2026
d27ea6f
refactor: apply SOLID principles and documentation refinements to ter…
MichaelFisher1997 Jan 26, 2026
bf4ff8e
refactor: address final code review feedback for PBR lighting fixes
MichaelFisher1997 Jan 26, 2026
96c54c6
refactor: finalize PBR energy conservation refinements
MichaelFisher1997 Jan 26, 2026
485fc4c
refactor: address final code review feedback for #230
MichaelFisher1997 Jan 26, 2026
ad690b6
fix: resolve shader compilation errors
MichaelFisher1997 Jan 26, 2026
f995bc2
fix: resolve missing getVolShadow function in terrain shader
MichaelFisher1997 Jan 26, 2026
2b57010
feat(graphics): implement industry-grade shadow system with Reverse-Z…
MichaelFisher1997 Jan 26, 2026
50811d8
fix(graphics): resolve shadow regression and stabilize CSM
MichaelFisher1997 Jan 26, 2026
77fad1e
fix(graphics): stabilize CSM snapping and correct shadow bounds check
MichaelFisher1997 Jan 27, 2026
68110e1
merge: resolve conflicts in terrain.frag and regenerate shaders
MichaelFisher1997 Jan 27, 2026
bef8f5d
Consolidated Keymap Improvements: Bug Fixes, Debouncing, and Human-Re…
MichaelFisher1997 Jan 27, 2026
589479b
fix(graphics): address critical review feedback for shadow system
MichaelFisher1997 Jan 27, 2026
13cf280
fix(graphics): finalize shadow system with review-addressed improvements
MichaelFisher1997 Jan 27, 2026
91794ff
Refactor Input system to use SOLID interfaces (Phase 3) (#242)
MichaelFisher1997 Jan 27, 2026
ad17347
fix(graphics): address all review feedback and finalize shadow system
MichaelFisher1997 Jan 27, 2026
75af4cf
fix(graphics): stop SSAO artifacts in LOD
MichaelFisher1997 Jan 28, 2026
32883f4
fix: cloud shadow blob artifacts
MichaelFisher1997 Jan 28, 2026
7fab600
fix(shadows): Fix shadow artifacts and add configurable shadow distan…
MichaelFisher1997 Jan 28, 2026
d232511
refactor(vulkan): PR1 - Add PipelineManager and RenderPassManager mod…
MichaelFisher1997 Jan 29, 2026
88d7d98
refactor(vulkan): PR2 - Migrate to Pipeline and Render Pass Managers …
MichaelFisher1997 Feb 6, 2026
8b277d2
refactor(vulkan): split monolithic RHI backend into focused modules (…
MichaelFisher1997 Feb 6, 2026
6e3c69a
refactor: separate LOD logic from GPU operations in lod_manager.zig (…
MichaelFisher1997 Feb 6, 2026
a7458db
refactor(worldgen): split overworld generator into focused subsystems…
MichaelFisher1997 Feb 6, 2026
af86a91
ci(workflows): migrate opencode from MiniMax to Kimi k2p5 and enhance…
MichaelFisher1997 Feb 6, 2026
f119da6
fix(workflows): prevent opencode temp files from triggering infinite …
MichaelFisher1997 Feb 7, 2026
58566a3
fix(workflows): remove file-based diff fetching, add timeout
MichaelFisher1997 Feb 7, 2026
8dda26c
refactor(worldgen): split biome.zig into focused sub-modules (#257)
MichaelFisher1997 Feb 7, 2026
7944d36
ci(workflows): enhance opencode review to check linked issues
MichaelFisher1997 Feb 7, 2026
d7fd4a4
refactor(world): extract chunk_mesh.zig meshing stages into independe…
MichaelFisher1997 Feb 7, 2026
3bba5f8
fix(shadows): resolve intermittent massive shadow artifact below play…
MichaelFisher1997 Feb 7, 2026
e221c38
feat(lighting): Complete Phases A & C of Modern Lighting Overhaul (#261)
MichaelFisher1997 Feb 7, 2026
8005ace
ci(workflows): add previous review tracking to opencode PR reviews
MichaelFisher1997 Feb 8, 2026
f96164a
fix(workflows): fix heredoc delimiter syntax in opencode workflow
MichaelFisher1997 Feb 8, 2026
a3325b3
feat(lighting): implement LPV compute GI and debug tooling (#262)
MichaelFisher1997 Feb 8, 2026
dc1ab06
feat(lighting): PCSS soft shadows, SH L1 LPV with occlusion, LUT colo…
MichaelFisher1997 Feb 8, 2026
65d51d5
Merge origin/main into dev
MichaelFisher1997 Feb 8, 2026
9170931
fix(lpv,lod): harden failure paths and runtime guards
MichaelFisher1997 Feb 8, 2026
8133d8d
chore(docs): remove obsolete PR2 investigation notes
MichaelFisher1997 Feb 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 153 additions & 6 deletions .github/workflows/opencode-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
# Don't run on draft PRs; do run when they become ready_for_review.
if: ${{ github.event.pull_request.draft == false }}
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 10
permissions:
id-token: write
contents: write
Expand All @@ -18,12 +19,59 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Fetch previous opencode reviews
id: previous-reviews
run: |
# Get PR number
PR_NUMBER="${{ github.event.pull_request.number }}"

# Fetch review comments from opencode-agent
echo "Fetching previous automated reviews..."

# Get all reviews
gh api /repos/${{ github.repository }}/pulls/${PR_NUMBER}/reviews \
--jq '.[] | select(.user.login == "opencode-agent[bot]") | {body: .body, submitted_at: .submitted_at}' > /tmp/opencode_reviews.json 2>/dev/null || echo "[]" > /tmp/opencode_reviews.json

# Get all PR review comments (inline comments)
gh api /repos/${{ github.repository }}/pulls/${PR_NUMBER}/comments \
--jq '.[] | select(.user.login == "opencode-agent[bot]") | {body: .body, path: .path, line: .line, created_at: .created_at}' > /tmp/opencode_comments.json 2>/dev/null || echo "[]" > /tmp/opencode_comments.json

# Format the previous reviews for the prompt
# Use a simpler approach without heredoc to avoid delimiter issues
REVIEW_CONTENT="## Previous Automated Reviews from opencode-agent:\n\n"

# Process reviews
if [ -s /tmp/opencode_reviews.json ] && [ "$(cat /tmp/opencode_reviews.json)" != "[]" ]; then
while IFS= read -r review; do
if [ -n "$review" ] && [ "$review" != "null" ]; then
body=$(echo "$review" | jq -r '.body // empty')
date=$(echo "$review" | jq -r '.submitted_at // empty')
if [ -n "$body" ] && [ "$body" != "null" ]; then
REVIEW_CONTENT="${REVIEW_CONTENT}### Review from ${date}\n${body}\n\n---\n\n"
fi
fi
done < /tmp/opencode_reviews.json
else
REVIEW_CONTENT="${REVIEW_CONTENT}No previous automated reviews found.\n"
fi

# Write to environment file using proper escaping
echo "PREVIOUS_REVIEWS<<EOF" >> $GITHUB_ENV
printf '%s\n' "$REVIEW_CONTENT" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

echo "Previous reviews fetched and formatted for context"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v16

Expand All @@ -36,12 +84,111 @@ jobs:
- name: Run opencode
uses: anomalyco/opencode/github@latest
env:
MINIMAX_API_KEY: ${{ secrets.MINIMAX_API_KEY }}
KIMI_API_KEY: ${{ secrets.KIMI_API_KEY }}
with:
model: minimax-coding-plan/MiniMax-M2.1
model: kimi-for-coding/k2p5
prompt: |
1. If the PR tags or references any issues (e.g., "Fixes #123"), verify if the implementation fully satisfies the requirements of those issues. If no issues are tagged, proceed without mentioning it.
2. If there are previous code reviews on this PR, verify if the feedback has been addressed. If there are no previous reviews, do not mention their absence.
3. Analyze for code quality issues, potential bugs, and architectural improvements.
4. Enforce SOLID principles. Provide a table breakdown scoring the PR on each of the 5 SOLID points (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion). For each point, provide a score (e.g., 0-10 or N/A) and specific, actionable suggestions on where and how to improve.
You are reviewing a pull request.

${{ env.PREVIOUS_REVIEWS }}

---

**YOUR TASK:** Analyze the CURRENT code changes and previous reviews above, then output your review in the following STRICT STRUCTURE:

**CRITICAL INSTRUCTIONS:**
1. **CHECK PREVIOUS ISSUES FIRST:** Look at the "Previous Automated Reviews" section above. For each issue previously reported (Critical, High, Medium, Low), verify if it still exists in the current code.
2. **ACKNOWLEDGE FIXES:** If a previously reported issue has been fixed, state "✅ **[FIXED]** Previous issue: [brief description]" in the appropriate section.
3. **ONLY REPORT NEW/UNRESOLVED ISSUES:** Do NOT re-report issues that have already been fixed. Only report issues that are still present in the current code.
4. **TRACK CHANGES:** If an issue was reported in a previous review but the code has changed, verify the new code and report the issue with updated file:line references if it still exists.

---

## 📋 Summary
First, check if the PR description mentions any linked issues (e.g., "Closes #123", "Fixes #456", "Resolves #789").

If linked issues are found:
- Mention the issue number(s) explicitly
- Verify the PR actually implements what the issue(s) requested
- State whether the implementation fully satisfies the issue requirements

Then provide 2-3 sentences summarizing the PR purpose, scope, and overall quality.

## 🔴 Critical Issues (Must Fix - Blocks Merge)
**IMPORTANT:** Check previous reviews first. If critical issues were reported before, verify if they're fixed. If fixed, say "✅ All previously reported critical issues have been resolved."

Only report NEW critical issues that could cause crashes, security vulnerabilities, data loss, or major bugs.

For each issue, use this exact format:
```
**[CRITICAL]** `File:Line` - Issue Title
**Confidence:** High|Medium|Low (how sure you are this is a real problem)
**Description:** Clear explanation of the issue
**Impact:** What could go wrong if merged
**Suggested Fix:** Specific code changes needed
```

## ⚠️ High Priority Issues (Should Fix)
Same approach as Critical - check previous reviews first, acknowledge fixes, only report unresolved issues.

Same format as Critical, but with **[HIGH]** prefix.

## 💡 Medium Priority Issues (Nice to Fix)
Same approach - verify previous reports, acknowledge fixes, report only still-present issues.

Same format, with **[MEDIUM]** prefix.

## ℹ️ Low Priority Suggestions (Optional)
Same approach.

Same format, with **[LOW]** prefix.

## 📊 SOLID Principles Score
| Principle | Score | Notes |
|-----------|-------|-------|
| Single Responsibility | 0-10 | Brief justification |
| Open/Closed | 0-10 | Brief justification |
| Liskov Substitution | 0-10 | Brief justification |
| Interface Segregation | 0-10 | Brief justification |
| Dependency Inversion | 0-10 | Brief justification |
| **Average** | **X.X** | |

## 🎯 Final Assessment

### Overall Confidence Score: XX%
Rate your confidence in this PR being ready to merge (0-100%).
**How to interpret:**
- 0-30%: Major concerns, do not merge without significant rework
- 31-60%: Moderate concerns, several issues need addressing
- 61-80%: Minor concerns, mostly ready with some fixes
- 81-100%: High confidence, ready to merge or with trivial fixes

### Confidence Breakdown:
- **Code Quality:** XX% (how well-written is the code?)
- **Completeness:** XX% (does it fulfill requirements?)
- **Risk Level:** XX% (how risky is this change?)
- **Test Coverage:** XX% (are changes adequately tested?)

### Merge Readiness:
- [ ] All critical issues resolved
- [ ] SOLID average score >= 6.0
- [ ] Overall confidence >= 60%
- [ ] No security concerns
- [ ] Tests present and passing (if applicable)

### Verdict:
**MERGE** | **MERGE WITH FIXES** | **DO NOT MERGE**

One-sentence explanation of the verdict.

---

**Review Guidelines:**
1. **MOST IMPORTANT:** Always check previous reviews and verify if issues are fixed before reporting them again
2. Acknowledge fixes explicitly with ✅ **[FIXED]** markers
3. Check the PR description for linked issues ("Fixes #123", "Closes #456", etc.) and verify the implementation
4. Be extremely specific with file paths and line numbers
5. Confidence scores should reflect how certain you are - use "Low" when unsure
6. If you have nothing meaningful to add to a section, write "None identified" instead of omitting it
7. Always provide actionable fixes, never just complaints

4 changes: 2 additions & 2 deletions .github/workflows/opencode-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
- uses: anomalyco/opencode/github@latest
if: steps.check.outputs.result == 'true'
env:
MINIMAX_API_KEY: ${{ secrets.MINIMAX_API_KEY }}
KIMI_API_KEY: ${{ secrets.KIMI_API_KEY }}
with:
model: minimax-coding-plan/MiniMax-M2.1
model: kimi-for-coding/k2p5
prompt: |
Analyze this issue. You have access to the codebase context.
**CRITICAL: Your only allowed action is to post a COMMENT on the issue. DO NOT create branches, pull requests, or attempt to modify the codebase.**
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/opencode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ jobs:
- name: Run opencode
uses: anomalyco/opencode/github@latest
env:
MINIMAX_API_KEY: ${{ secrets.MINIMAX_API_KEY }}
KIMI_API_KEY: ${{ secrets.KIMI_API_KEY }}
with:
model: minimax-coding-plan/MiniMax-M2.1
model: kimi-for-coding/k2p5
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ test_output.txt
*.swp
.DS_Store
*.spv
!assets/shaders/vulkan/lpv_inject.comp.spv
!assets/shaders/vulkan/lpv_propagate.comp.spv
wiki/
*.exr
*.hdr
Expand Down
4 changes: 4 additions & 0 deletions assets/config/presets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"name": "LOW",
"shadow_quality": 0,
"shadow_distance": 150.0,
"shadow_pcf_samples": 4,
"shadow_cascade_blend": false,
"pbr_enabled": false,
Expand All @@ -26,6 +27,7 @@
{
"name": "MEDIUM",
"shadow_quality": 1,
"shadow_distance": 250.0,
"shadow_pcf_samples": 8,
"shadow_cascade_blend": false,
"pbr_enabled": true,
Expand All @@ -50,6 +52,7 @@
{
"name": "HIGH",
"shadow_quality": 2,
"shadow_distance": 500.0,
"shadow_pcf_samples": 12,
"shadow_cascade_blend": true,
"pbr_enabled": true,
Expand All @@ -74,6 +77,7 @@
{
"name": "ULTRA",
"shadow_quality": 3,
"shadow_distance": 1000.0,
"shadow_pcf_samples": 16,
"shadow_cascade_blend": true,
"pbr_enabled": true,
Expand Down
2 changes: 2 additions & 0 deletions assets/shaders/vulkan/g_pass.frag
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ layout(set = 0, binding = 0) uniform GlobalUniforms {
vec4 pbr_params;
vec4 volumetric_params;
vec4 viewport_size;
vec4 lpv_params;
vec4 lpv_origin;
} global;

// 4x4 Bayer matrix for dithered LOD transitions
Expand Down
71 changes: 71 additions & 0 deletions assets/shaders/vulkan/lpv_inject.comp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#version 450

layout(local_size_x = 4, local_size_y = 4, local_size_z = 4) in;

struct LightData {
vec4 pos_radius;
vec4 color;
};

// SH L1: 3 output images (R, G, B), each storing 4 SH coefficients (L0, L1x, L1y, L1z)
layout(set = 0, binding = 0, rgba32f) uniform writeonly image3D lpv_out_r;
layout(set = 0, binding = 1, rgba32f) uniform writeonly image3D lpv_out_g;
layout(set = 0, binding = 2, rgba32f) uniform writeonly image3D lpv_out_b;

layout(set = 0, binding = 3) readonly buffer Lights {
LightData lights[];
} light_buffer;

layout(push_constant) uniform InjectPush {
vec4 grid_origin_cell;
vec4 grid_params;
uint light_count;
} push_data;

// SH L1 basis functions (unnormalized for compact storage)
// Y_00 = 0.282095 (DC)
// Y_1m = 0.488603 * {x, y, z} (directional)
const float SH_C0 = 0.282095;
const float SH_C1 = 0.488603;

void main() {
int gridSize = int(push_data.grid_params.x);
ivec3 cell = ivec3(gl_GlobalInvocationID.xyz);
if (any(greaterThanEqual(cell, ivec3(gridSize)))) {
return;
}

vec3 world_pos = push_data.grid_origin_cell.xyz + vec3(cell) * push_data.grid_origin_cell.w + vec3(0.5 * push_data.grid_origin_cell.w);

// Accumulate SH coefficients per color channel
vec4 sh_r = vec4(0.0); // (L0, L1x, L1y, L1z) for red
vec4 sh_g = vec4(0.0); // for green
vec4 sh_b = vec4(0.0); // for blue

for (uint i = 0; i < push_data.light_count; i++) {
vec3 light_pos = light_buffer.lights[i].pos_radius.xyz;
float radius = max(light_buffer.lights[i].pos_radius.w, 0.001);
vec3 light_color = light_buffer.lights[i].color.rgb;

vec3 diff = world_pos - light_pos;
float d = length(diff);
if (d < radius) {
float att = 1.0 - (d / radius);
att *= att;

// Direction from light to cell (normalized), used for SH L1 directional encoding
vec3 dir = (d > 0.001) ? normalize(diff) : vec3(0.0, 1.0, 0.0);

// SH L1 projection: project the incoming radiance along direction
vec4 sh_coeffs = vec4(SH_C0, SH_C1 * dir.x, SH_C1 * dir.y, SH_C1 * dir.z);

sh_r += sh_coeffs * light_color.r * att;
sh_g += sh_coeffs * light_color.g * att;
sh_b += sh_coeffs * light_color.b * att;
}
}

imageStore(lpv_out_r, cell, sh_r);
imageStore(lpv_out_g, cell, sh_g);
imageStore(lpv_out_b, cell, sh_b);
}
Binary file added assets/shaders/vulkan/lpv_inject.comp.spv
Binary file not shown.
Loading
Loading