Skip to content

feat: detect obsolete shader mods with no feature INIs#2074

Closed
brucenguyen wants to merge 1 commit into
community-shaders:devfrom
brucenguyen:detect-vanilla-hdr
Closed

feat: detect obsolete shader mods with no feature INIs#2074
brucenguyen wants to merge 1 commit into
community-shaders:devfrom
brucenguyen:detect-vanilla-hdr

Conversation

@brucenguyen
Copy link
Copy Markdown
Contributor

@brucenguyen brucenguyen commented Apr 8, 2026

Open to feedback on the infrastructure or UX.

The purpose of this change is to detect Vanilla HDR, which is a mod that includes shader files but does not include a feature INI file. This causes shader compilation failures.

The idea behind this implementation is that a developer can easily add a new entry in s_obsoleteShaderModTriggerPaths with a trigger path. This hypothetically can expand outside of the Shaders directory and detect all sorts of mods.

image

Summary by CodeRabbit

  • New Features

    • Added detection system for obsolete and incompatible shader mods.
  • Bug Fixes

    • Improved safety validation when removing features or mods.
    • Enhanced post-configuration validation during startup.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 8, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a286389f-5d2a-43a2-a558-3f7fd9e430cd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR extends the feature-issue detection system to identify obsolete shader mods (specifically VanillaHDR) that contain shader files but lack corresponding feature INIs, adds a new scanning function to detect these orphaned files, and tightens deletion UI eligibility by requiring file-info presence. The scanning is integrated into the state-loading flow.

Changes

Cohort / File(s) Summary
Upscaling.ini Formatting
features/Upscaling/Shaders/Features/Upscaling.ini
Normalized line endings from Windows-style CRLF to standard LF and added trailing newline; no configuration changes.
Obsolete Shader Mod Detection
src/FeatureIssues.cpp, src/FeatureIssues.h
Added VanillaHDR to obsolete feature metadata, introduced trigger-path map for shader-file detection, implemented ScanForObsoleteShaderMods() to scan the shaders directory and create feature issues for detected obsolete mods, and updated deletion UI eligibility to require file info presence.
State Loading Integration
src/State.cpp
Integrated ScanForObsoleteShaderMods() call into the state-loading flow immediately after orphaned INI scanning.

Sequence Diagram

sequenceDiagram
    participant State as State::Load
    participant FI as FeatureIssues
    participant FS as Filesystem
    
    State->>FI: ScanForOrphanedFeatureINIs()
    FI->>FS: Check for orphaned INIs
    FI-->>State: Return
    
    State->>FI: ScanForObsoleteShaderMods() [NEW]
    FI->>FS: Scan shaders directory
    loop For each obsolete trigger path
        FS-->>FI: Check for trigger file<br/>(e.g., ISHDR/VanillaHDRSettings.fxh)
        alt Trigger file found
            FI->>FI: Create feature issue<br/>(OBSOLETE or UNKNOWN)
        end
    end
    FI-->>State: Return
    
    State->>State: Log "Loading Settings Complete"
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • alandtse
  • doodlum

Poem

🐰 A rabbit hops through shader mods so grand,
Seeking obsolete files scattered across the land.
With VanillaHDR now marked and found,
The cleanup scan completes without a sound. 🧹

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: detect obsolete shader mods with no feature INIs' directly and accurately summarizes the main change: detecting obsolete shader mods lacking feature INI files, which is the core functionality added across all modified files.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 Apr 8, 2026

No actionable suggestions for changed features.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

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

Copy link
Copy Markdown
Collaborator

@alandtse alandtse left a comment

Choose a reason for hiding this comment

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

I don't like hardcoding this. If we're going to keep data like this, we should probably just have it as a data file so we don't have to recompile every time to change it.

@brucenguyen
Copy link
Copy Markdown
Contributor Author

brucenguyen commented Apr 8, 2026

A data file seems inconsistent. It would be strange to implement this via data file and the rest of the feature issues system (min version, obsolete features, etc.) be hard-coded in source.

@brucenguyen
Copy link
Copy Markdown
Contributor Author

brucenguyen commented Apr 8, 2026

To be clear, I'm not against the approach. But it seems like we should at least be consistent, so either the feature issues system should be driven by data files or should remain hard-coded.

Similar hard-coded patterns exist, such as incompatible DLL detection.

@alandtse
Copy link
Copy Markdown
Collaborator

alandtse commented Apr 8, 2026

They're different. Features are actually cpp and part of this repo and must be registered in cpp to even interact with the dll. It's intended to allow cross linking between features that cause constraints, etc.

Having a hardcoded list of unrelated third-party products in cpp has always been a bad pattern in this repo. There's been a lot of decisions that have resulted in tech debt. I don't believe we should've hard coded a crash logger requirement for example (despite the fact it's mine).

If you strongly feel like we should overload an internal feature constraints system with random mods and you're willing to maintain it, then ok.

@brucenguyen brucenguyen marked this pull request as draft April 8, 2026 05:34
@brucenguyen
Copy link
Copy Markdown
Contributor Author

brucenguyen commented Apr 8, 2026

I don't feel strongly about it. I can look into using a JSON file instead for third-party incompatibilities.

Is it fine that I keep using the feature issues UI for this right? As long as I separate concerns from the internal feature constraints system? e.g., instead of using the s_obsoleteFeatureData map intended for internal features, I use an entirely different system that leverages the JSON? etc. etc. Or do you think it's worth it to build an entirely separate "Compatibility Issues" section?

@alandtse
Copy link
Copy Markdown
Collaborator

alandtse commented Apr 8, 2026

I guess I see your point we have some infrastructure built up. Perhaps we should consider an architecture where compatibility issues are a parent class and feature issues a subclass? Maybe see what AI thinks is the better approach. The class of compatibility issues could expand indefinitely while the feature issues should be constrained.

@brucenguyen
Copy link
Copy Markdown
Contributor Author

Ran through Opus. It argues that conceptually it makes sense but implementation-wise there's not much overlap, other than the UI being similar.

I bothered it a bit to see if there was any bias on my end (from the chat and the existing branch) and it seemed to be pretty consistent on preferring it remain separate based on your feedback.

So the approach I'm going to move forward with is implementing a completely separate CompatibilityIssues system. I'll commit those changes and undraft this when I have free time (bot can write a lot of it but I'll need to review and test). If you prefer something else or disagree lmk.

@alandtse
Copy link
Copy Markdown
Collaborator

If you think your time is spent better on other fixes, then do that. If a quick fix here is warranted, then we could do this with a follow-up for a real system after. I know pre-commit was forcing the upscaling.ini, but if you rebase it should stop forcing it and you can also just delete your changes. There was a bug in one of the scripts that impacted this.

@brucenguyen
Copy link
Copy Markdown
Contributor Author

No rush in my opinion. If a new user reports a error due to Vanilla HDR, the community seems pretty active on catching it and flagging, if not I will.

So I'm totally okay with keeping this PR open until we're happy on the approach. At the end of the day, I think the critical issues with CS are the ones that stop people from using it, and this is unlikely one of them.

@brucenguyen
Copy link
Copy Markdown
Contributor Author

Looks like Vanilla HDR was hidden on the Nexus, so that sort of solves the issue that this change was trying to solve.

If you think the infra for a general compatibility system is worth it then feel free to get the rabbit to make an issue. Alternatively it could create an issue to refactor the current DLL compatibility system instead.

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.

2 participants