Skip to content

fix: sync upstream Community Shaders v1.6.1 hotfix#74

Merged
alandtse merged 7 commits into
devfrom
sync/upstream-1.6.1-hotfix
Jun 2, 2026
Merged

fix: sync upstream Community Shaders v1.6.1 hotfix#74
alandtse merged 7 commits into
devfrom
sync/upstream-1.6.1-hotfix

Conversation

@alandtse
Copy link
Copy Markdown
Owner

@alandtse alandtse commented Jun 2, 2026

What

Syncs upstream community-shaders hotfix/1.6.x (the staged v1.6.1 hotfix) onto our 1.6.0 base, and folds in the Terrain Helper AIO inclusion (supersedes #73). Cuts our v1.6.1, aligned with upstream's.

Upstream fixes pulled in

Resolution (per our upstream-merge pattern)

Net diff vs dev: 6 files (4 code fixes + audit script + the .ini) — no pipeline drift.

⚠️ Notes

  • Upstream is staged but not yet tagged v1.6.1 — re-verify against the tag when published (you approved syncing the staged branch now).
  • Merge this with a merge commit (not squash) to preserve upstream's fix: attribution and let semantic-release count them toward the 1.6.1 bump.

Closes #73.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for water blend history tracking.
  • Bug Fixes

    • Improved water blending calculations for more accurate rendering.
    • Refined environment map detection logic in lighting systems.
    • Fixed water tile visibility handling at different distances.

SkrubbySkrubInAShrub and others added 7 commits June 1, 2026 18:18
Sync the fixes staged on community-shaders hotfix/1.6.x onto our 1.6.0
base: snow render targets → fp16 (banding), emat solid-black height masks,
water blending/ghosting + LOD gaps, and the feature-audit AuditVersion
opt-out.

Resolution per our upstream-merge pattern:
- Fork pipeline workflows kept (--ours); upstream's divergent CI changes
  dropped (release-build et al.).
- tools/feature_version_audit.py: take upstream's AuditVersion opt-out.
- Terrain Helper .ini: AuditVersion = false (upstream, activation-only) +
  autoupload = true (fork — we ship it in the AIO). Folds PR #73.

Upstream is staged, not yet tagged v1.6.1 — re-verify against the tag when
published.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 2, 2026 00:34
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR re-enables Terrain Helper in the AIO bundle and adds version audit opt-out support. It includes three independent water rendering improvements: un-premultiplied blend history, refined environment mask format detection, and water visibility tied to cell flags. Render targets are upgraded to higher-precision float formats.

Changes

Water Rendering & Visibility Improvements

Layer / File(s) Summary
Water Blend History Implementation
package/Shaders/ISWaterBlend.hlsl, src/Hooks.cpp
Water history is un-premultiplied before blending and the output is premultiplied. A new render hook clears stale coverage before shader execution. Snow render targets are upgraded from R8G8B8A8_UNORM to R16G16B16A16_FLOAT format.
Envmask Grayscale Format Detection
package/Shaders/Lighting.hlsl
Environment mask validation now computes grayscaleMask (RGB channels equal within epsilon) and solidBlackHeightMask (near-black RGB with mid-range alpha). Only true grayscale masks are rejected; height-only masks are preserved.
Water Visibility by Cell Flag
src/Features/UnifiedWater.cpp
Water tile LOD visibility now queries the cell's kHasWater flag to determine culling instead of relying solely on attached-cell state.

Terrain Helper AIO & Version Audit Opt-out

Layer / File(s) Summary
Terrain Helper AIO Configuration
features/Terrain Helper/Shaders/Features/TerrainHelper.ini
Sets AuditVersion = false and autoupload = true to bundle Terrain Helper in the AIO without triggering version audit churn.
Feature Audit Version Opt-out Support
tools/feature_version_audit.py
Metadata parsing now includes audit_version flag (default enabled). Only explicit falsy values (false, 0, no, off) disable auditing. Features with audit_version = false skip version bump suggestions and PR-check failures.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 Water history flows without premultiplication,
Envmasks speak truth—tall masks claim their fruition,
Terrain Helper bundled, audit opt-out calls,
Snow renders in float where precision enthralls.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: syncing upstream Community Shaders v1.6.1 hotfix to resolve water blending, LOD, snow render target, and audit script issues.
Linked Issues check ✅ Passed All code changes satisfy linked issue #73 objectives: TerrainHelper.ini enables autoupload and sets AuditVersion=false, feature_version_audit.py implements the audit opt-out, and upstream hotfix changes (water, lighting, LOD, hooks) are included.
Out of Scope Changes check ✅ Passed All changes are in scope: TerrainHelper.ini/audit script address #73, while the four shader/code fixes (ISWaterBlend, Lighting, UnifiedWater, Hooks, snow targets) are part of the upstream v1.6.1 hotfix being synced.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/upstream-1.6.1-hotfix

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.22.0)

OpenGrep fatal error (exit code 2): [00.17][ERROR]: Error: exception Unix_error: No such file or directory stat src/Hooks.cpp
Raised by primitive operation at UTmp.replace_named_pipe_by_regular_file_if_needed in file "libs/commons/UTmp.ml", line 145, characters 8-27
Called from Scan_CLI.replace_target_roots_by_regular_files_where_needed.(fun) in file "src/osemgrep/cli_scan/Scan_CLI.ml", lines 1086-1087, characters 19-65
Called from List_.fast_map in file "libs/commons/List_.ml", line 81, characters 17-20
Called from Scan_CLI.repla

🔧 Infer (1.2.0)
src/Features/UnifiedWater.cpp

Usage Error: Failed to execute compilation command:
'/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/clang/install/bin/clang++'
-c src/Features/UnifiedWater.cpp -o
/tmp/coderabbit-infer/69e06f8bf9ef95e0/file.o

Error message:
clang++: error: no such file or directory: 'src/Features/UnifiedWater.cpp'

*** Infer needs a working compilation command to run.

src/Hooks.cpp

Usage Error: Failed to execute compilation command:
'/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/clang/install/bin/clang++'
-c src/Hooks.cpp -o /tmp/coderabbit-infer/11ef886409eccad2/file.o

Error message:
clang++: error: no such file or directory: 'src/Hooks.cpp'

*** Infer needs a working compilation command to run.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Actionable Suggestions

  • Terrain Helper (Alan Tse): Needs version bump to 1-0-2

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Syncs the upstream Community Shaders hotfix/1.6.x (staged v1.6.1 hotfix) into this fork’s 1.6.0 base, including the Terrain Helper AIO inclusion and the upstream AuditVersion opt-out support for the feature audit tool.

Changes:

  • Update the feature version audit script to support AuditVersion = false to fully opt a feature out of version auditing/bump suggestions.
  • Apply upstream rendering fixes: promote snow RTs to fp16 to reduce banding, adjust water history handling to reduce blending/ghosting artifacts, and refine water LOD culling behavior.
  • Fix extended material mask handling to preserve valid “height-only” masks while still rejecting incorrect grayscale environment masks; enable Terrain Helper autoupload while opting it out of audit-version churn.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/feature_version_audit.py Adds audit_version metadata parsing and skips version auditing for features with AuditVersion = false.
src/Hooks.cpp Hooks water blend render to clear stale history coverage; promotes snow render targets to fp16 during RT creation.
src/Features/UnifiedWater.cpp Adjusts LOD culling to keep LOD visible for loaded cells that don’t actually have water.
package/Shaders/Lighting.hlsl Fixes complex material detection to avoid incorrectly rejecting solid-black height-only masks.
package/Shaders/ISWaterBlend.hlsl Stores premultiplied history and un-premultiplies on read to reduce edge darkening/ghosting.
features/Terrain Helper/Shaders/Features/TerrainHelper.ini Sets AuditVersion = false and autoupload = true for Terrain Helper.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/Hooks.cpp (1)

584-605: 🏗️ Heavy lift

Consider gating the fp16 snow targets behind a quality toggle.

kSNOW and kSNOW_SWAP moving from R8G8B8A8_UNORM to R16G16B16A16_FLOAT increases bandwidth and RT memory pressure on every snow pass. That seems justified for the banding fix, but it is still a performance-sensitive graphics change and should ideally be user-configurable, especially for VR/lower-end GPUs.

As per coding guidelines, "Always consider GPU workload and user experience when implementing graphics features" and "Flag potential performance impact issues for graphics features and suggest user toggles for performance-sensitive features".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Hooks.cpp` around lines 584 - 605, The change forces kSNOW and kSNOW_SWAP
targets to fp16 in CreateRenderTarget_Snow::thunk and
CreateRenderTarget_SnowSwap::thunk unconditionally; add a user-configurable
quality toggle check so fp16 is only set when high-snow-quality is enabled (and
otherwise keep the original format), e.g. consult a runtime setting or config
flag before calling
a_properties->format.set(RE::BSGraphics::Format::kR16G16B16A16_FLOAT) in both
CreateRenderTarget_Snow and CreateRenderTarget_SnowSwap, defaulting to current
behavior for low/VR/low-end profiles and ensuring the code falls back to the
original R8G8B8A8_UNORM when the toggle is off.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/Hooks.cpp`:
- Around line 584-605: The change forces kSNOW and kSNOW_SWAP targets to fp16 in
CreateRenderTarget_Snow::thunk and CreateRenderTarget_SnowSwap::thunk
unconditionally; add a user-configurable quality toggle check so fp16 is only
set when high-snow-quality is enabled (and otherwise keep the original format),
e.g. consult a runtime setting or config flag before calling
a_properties->format.set(RE::BSGraphics::Format::kR16G16B16A16_FLOAT) in both
CreateRenderTarget_Snow and CreateRenderTarget_SnowSwap, defaulting to current
behavior for low/VR/low-end profiles and ensuring the code falls back to the
original R8G8B8A8_UNORM when the toggle is off.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 35db8d9c-c510-4398-98cc-29f6df5ac8f0

📥 Commits

Reviewing files that changed from the base of the PR and between 8ff96d1 and 28c49c5.

📒 Files selected for processing (6)
  • features/Terrain Helper/Shaders/Features/TerrainHelper.ini
  • package/Shaders/ISWaterBlend.hlsl
  • package/Shaders/Lighting.hlsl
  • src/Features/UnifiedWater.cpp
  • src/Hooks.cpp
  • tools/feature_version_audit.py

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

✅ A pre-release build is available for this PR:
Download

@alandtse alandtse merged commit d9bee54 into dev Jun 2, 2026
22 of 23 checks passed
@alandtse alandtse deleted the sync/upstream-1.6.1-hotfix branch June 2, 2026 01:50
alandtse added a commit that referenced this pull request Jun 2, 2026
## What
- **Regenerate** `.github/configs/shader-validation{,-vr}.yaml` from
fresh Debug-level `CommunityShaders.log` captures on the deployed
**1.6.1** build (SE + VR), via `generate-shader-configs.ps1`. Picks up
permutation changes from the 1.6.1 shader fixes (`Lighting.hlsl`,
`ISWaterBlend.hlsl`). Both regenerated **0 errors** (SE 24 shaders /
3324 variants, VR 25 / 3617).
- **Add** `docs/development/release-validation.md` — runbook for in-game
release validation via the devbench MCP (shader-cache gate, feature
load, in-game load, log scan) + the config-refresh procedure.

## On the large diff
The config diff is a **full mechanical regen** (variant reordering +
1.6.1 additions; files grew SE +2.3k / VR +6k lines), **not
hand-edited**. Don't review line-by-line — the **shader-validation CI
job validates it** by compiling every variant in the matrix.

## Validation that produced this
Built + deployed 1.6.1 (PR #74 content) to SE + VR; via devbench MCP
both editions passed: **0 failed shaders**, **all features loaded** (37
VR / 36 SE), `loadLast` → WhiterunWorld with **no CTD**, and **0 `[E]`
log errors** traceable to 1.6.1 (only pre-existing
Streamline/terrain/WeatherEditor notices).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Added a new development guide for validating release builds using
internal testing tools and procedures.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants