From cda40c611081adcca091b01e5743b7a7b7d7b765 Mon Sep 17 00:00:00 2001 From: TheMeinerLP Date: Sun, 26 Apr 2026 19:36:13 +0200 Subject: [PATCH 1/2] ci: add issue templates, update PR template, fix tier-2 GLSL validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue templates (YAML, replaces old .md): - bug-report: type dropdown, version fields, log + screenshot sections - symptom-request: clinical source required for new VSS effects - clinical-feedback: dedicated template for patients/clinicians - iris-compat: version-specific compatibility reports PR template: updated for conventional commits, removed manual CHANGELOG requirement Tier-2 test rewrite: - Previous setup downloaded Fabric installer but never ran it, so MC client files did not exist — the launch command was a dead placeholder - New approach: lightweight Docker image (glslangValidator + Python), injects an Iris uniform shim into each .vsh/.fsh and validates with glslangValidator — no Minecraft needed, runs in ~60s - iris-compat.yml simplified: Tier 1 lint + Tier 2 GLSL validation, replaces the 7-job MC version matrix that could never actually run --- .github/ISSUE_TEMPLATE/bug-report.md | 50 ------- .github/ISSUE_TEMPLATE/bug-report.yml | 88 +++++++++++++ .github/ISSUE_TEMPLATE/clinical-feedback.yml | 59 +++++++++ .github/ISSUE_TEMPLATE/feature-request.md | 42 ------ .github/ISSUE_TEMPLATE/iris-compat.yml | 53 ++++++++ .github/ISSUE_TEMPLATE/symptom-request.yml | 55 ++++++++ .github/PULL_REQUEST_TEMPLATE.md | 45 +++---- .github/workflows/iris-compat.yml | 115 ++++------------ test/tier2-integration/Dockerfile | 67 ++-------- test/tier2-integration/entrypoint.sh | 132 +++++++------------ test/tier2-integration/iris-shim.glsl | 59 +++++++++ 11 files changed, 413 insertions(+), 352 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml create mode 100644 .github/ISSUE_TEMPLATE/clinical-feedback.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature-request.md create mode 100644 .github/ISSUE_TEMPLATE/iris-compat.yml create mode 100644 .github/ISSUE_TEMPLATE/symptom-request.yml create mode 100644 test/tier2-integration/iris-shim.glsl diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md deleted file mode 100644 index 285cee0..0000000 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: Bug Report -about: Shader effect doesn't work or Iris shows compile errors -title: '[Bug] ' -labels: bug -assignees: '' ---- - -## Description - -What is the observed behavior? What did you expect? - -## Reproduction - -1. Profile: -2. Symptoms enabled: -3. Steps to trigger: - - … - -## Versions - -- Minecraft: -- Iris: -- Sodium: -- GPU/Driver: -- Visual Snow Shader: - -## Logs - -For compile errors or crashes: - -
-latest.log excerpt - -``` -PASTE THE RELEVANT EXCERPT FROM .minecraft/logs/latest.log HERE -``` - -
- -## Screenshots - -For visual issues: please include before/after screenshots -(with/without shader, with/without the suspect effect). - -## Already Verified - -- [ ] `python3 test/tier1-lint/lint.py shaders/` reports no errors -- [ ] Iris is on a version listed in `.github/workflows/iris-compat.yml` -- [ ] No existing open issue covers this diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000..8b0a24b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,88 @@ +name: Bug Report +description: Something isn't rendering correctly or Iris shows compile errors +labels: ["bug"] +body: + - type: dropdown + id: bug-type + attributes: + label: What kind of bug? + options: + - Visual glitch / wrong effect + - Shader compile error in Iris + - Game crash after enabling shader + - Performance / FPS drop + - Effect not matching the selected profile + validations: + required: true + + - type: textarea + id: description + attributes: + label: What happened? + description: What did you see, and what did you expect instead? + validations: + required: true + + - type: textarea + id: repro + attributes: + label: Steps to reproduce + placeholder: | + 1. Profile: Minimal / Moderate / … + 2. Effects enabled: … + 3. … + validations: + required: true + + - type: input + id: mc-version + attributes: + label: Minecraft version + placeholder: "e.g. 1.21.1" + validations: + required: true + + - type: input + id: iris-version + attributes: + label: Iris version + placeholder: "e.g. 1.7.5" + validations: + required: true + + - type: input + id: shader-version + attributes: + label: Shader version + placeholder: "e.g. 0.8.0 — shown in the Iris shader menu" + validations: + required: true + + - type: input + id: gpu + attributes: + label: GPU and driver + placeholder: "e.g. NVIDIA RTX 4080, driver 555.42 / AMD RX 6800, Mesa 24.x" + + - type: textarea + id: log + attributes: + label: Log output + description: For compile errors or crashes — paste the relevant section from `.minecraft/logs/latest.log` + render: text + + - type: textarea + id: screenshots + attributes: + label: Screenshots + description: For visual issues — before/after, with/without the affected effect + + - type: checkboxes + id: checklist + attributes: + label: Before submitting + options: + - label: I checked there is no existing open issue for this + required: true + - label: The Iris version I'm using is listed in the README + required: false diff --git a/.github/ISSUE_TEMPLATE/clinical-feedback.yml b/.github/ISSUE_TEMPLATE/clinical-feedback.yml new file mode 100644 index 0000000..fd48af2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/clinical-feedback.yml @@ -0,0 +1,59 @@ +name: Clinical Accuracy Feedback +description: Something looks wrong compared to how VSS actually presents — from a patient or clinician +labels: ["clinical"] +body: + - type: markdown + attributes: + value: | + This template is for people with VSS or clinical experience who notice + that an effect is unrealistic — wrong intensity, wrong behaviour, or + missing nuance. You don't need a GitHub account history or technical + knowledge. Just describe what you see. + + - type: dropdown + id: affected-effect + attributes: + label: Which effect is inaccurate? + options: + - Static (core grain) + - Palinopsia (afterimages / trails) + - Photophobia (light sensitivity) + - Nyctalopia (night blindness) + - Floaters + - Blue Field Phenomenon + - Self-light / phosphenes + - General / multiple effects + - Not sure + validations: + required: true + + - type: textarea + id: what-is-wrong + attributes: + label: What is wrong or missing? + description: How does the shader differ from what you actually perceive? + validations: + required: true + + - type: textarea + id: how-it-should-look + attributes: + label: How should it look? + description: Describe as specifically as you can — colour, speed, intensity, when it occurs, etc. + + - type: textarea + id: source + attributes: + label: Source or reference (optional) + description: Clinical paper, patient forum thread, or personal experience — all are useful. + + - type: dropdown + id: background + attributes: + label: Your background (optional) + options: + - I have VSS (diagnosed) + - I have VSS (undiagnosed / self-identified) + - I'm a clinician or researcher + - I know someone with VSS + - Other / prefer not to say diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md deleted file mode 100644 index 02ea7f2..0000000 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -name: Feature Request / Symptom Suggestion -about: New VSS effect, new slider, or UX improvement -title: '[Feature] ' -labels: enhancement -assignees: '' ---- - -## What are you proposing? - -Brief description of the desired feature. - -## Clinical Context (for new symptoms) - -If this is about a new VSS symptom or adjusting an existing effect, -please cite a source: - -- **Study / source:** -- **Symptom prevalence:** -- **Visual description:** - -## Use Case - -Who benefits? Awareness, screening, playability? - -## Possible Implementation - -If you have an idea of how the effect could look: - -``` -Pseudo-code or GLSL sketch -``` - -## Alternatives - -Have you considered other approaches? - -## Willing to help? - -- [ ] I'd like to open a PR for this myself -- [ ] I can help with testing -- [ ] Suggestion only — someone else should implement diff --git a/.github/ISSUE_TEMPLATE/iris-compat.yml b/.github/ISSUE_TEMPLATE/iris-compat.yml new file mode 100644 index 0000000..7bedc19 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/iris-compat.yml @@ -0,0 +1,53 @@ +name: Iris Compatibility Issue +description: Shader doesn't load or behaves differently on a specific Iris / Minecraft version +labels: ["iris-compat", "bug"] +body: + - type: input + id: mc-version + attributes: + label: Minecraft version + placeholder: "e.g. 1.20.1" + validations: + required: true + + - type: input + id: iris-version + attributes: + label: Iris version + placeholder: "e.g. 1.6.17" + validations: + required: true + + - type: input + id: shader-version + attributes: + label: Shader version + placeholder: "e.g. 0.8.0" + validations: + required: true + + - type: dropdown + id: symptom + attributes: + label: What goes wrong? + options: + - Shader fails to compile / red error screen + - Effect looks different than on other versions + - Game crashes on shader load + - Shader loads but world geometry is wrong + - Other + validations: + required: true + + - type: textarea + id: description + attributes: + label: Description + validations: + required: true + + - type: textarea + id: log + attributes: + label: Relevant log output + render: text diff --git a/.github/ISSUE_TEMPLATE/symptom-request.yml b/.github/ISSUE_TEMPLATE/symptom-request.yml new file mode 100644 index 0000000..d464154 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/symptom-request.yml @@ -0,0 +1,55 @@ +name: New Symptom / Feature Suggestion +description: Suggest a new VSS effect or an improvement to an existing one +labels: ["enhancement"] +body: + - type: dropdown + id: request-type + attributes: + label: What kind of request? + options: + - New VSS symptom + - Adjust an existing effect (intensity, behavior, default) + - New profile + - UX / accessibility improvement + - Other + validations: + required: true + + - type: textarea + id: description + attributes: + label: What are you proposing? + description: Describe the effect or change as concretely as possible. + validations: + required: true + + - type: textarea + id: clinical-source + attributes: + label: Clinical source (required for new symptoms) + description: | + Link a peer-reviewed paper or PubMed entry. The shader only simulates + documented symptoms — we don't add effects without a source. + placeholder: | + Study: … + DOI / PubMed: … + Prevalence among VSS patients: … + How it looks perceptually: … + + - type: textarea + id: lived-experience + attributes: + label: Personal experience (optional) + description: | + If you have VSS or suspect you have it, describing what you actually + see is valuable — even without a clinical source. It helps us tune + defaults to something realistic. + + - type: checkboxes + id: willing + attributes: + label: Willing to help? + options: + - label: I'd like to open a PR for this myself + - label: I can help with testing + - label: Suggestion only diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c7006b1..8be89fe 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,39 +1,28 @@ ## What does this PR change? -Brief summary. Link issues with `Refs: #123`. + ## Type of change -- [ ] Bug fix -- [ ] New feature / symptom -- [ ] Refactor / performance -- [ ] Documentation -- [ ] CI / test infrastructure -- [ ] Translation / localization -- [ ] Breaking change +- [ ] Bug fix (`fix:`) +- [ ] New symptom / feature (`feat:`) +- [ ] Refactor / performance (`refactor:` / `perf:`) +- [ ] Documentation (`docs:`) +- [ ] CI / test infrastructure (`ci:`) +- [ ] Translation / localization (`i18n:`) +- [ ] Breaking change — use `feat!:` or add `BREAKING CHANGE:` in commit footer -## Clinical Source (for new symptoms) +## Clinical source (new or adjusted symptoms only) - + -## Test Status +## Checklist -- [ ] `python3 test/tier1-lint/lint.py shaders/` runs clean (0 errors) -- [ ] Tested locally in Iris, MC version: ___ -- [ ] For new sliders: German AND English labels in `lang/` -- [ ] CHANGELOG.md updated -- [ ] If breaking: title prefixed with `[BREAKING]` +- [ ] `python3 test/tier1-lint/lint.py shaders/` — 0 errors +- [ ] Tested in at least one Iris version locally +- [ ] New sliders: labels added to ALL `lang/*.lang` files +- [ ] Commit messages follow Conventional Commits (release-please reads them) -## Screenshots / Demo +## Screenshots / demo -For visual changes, please show before/after. - -## Iris Version Coverage - - - -| MC | Iris | Status | -|---|---|---| -| 1.21.1 | 1.7.5 | ✓ | -| 1.20.1 | 1.6.17 | not tested | + diff --git a/.github/workflows/iris-compat.yml b/.github/workflows/iris-compat.yml index 228f957..37857a4 100644 --- a/.github/workflows/iris-compat.yml +++ b/.github/workflows/iris-compat.yml @@ -1,119 +1,54 @@ -name: Iris Shader Compatibility +name: Shader Validation on: push: branches: [main] paths: - 'shaders/**' - - 'shaders.properties' + - 'test/tier2-integration/**' pull_request: paths: - 'shaders/**' + - 'test/tier2-integration/**' workflow_dispatch: jobs: - # ═══════════════════════════════════════════════════ - # TIER 1 — Static linter (~10 seconds) - # ═══════════════════════════════════════════════════ + # ─────────────────────────────────────────────────── + # TIER 1 — fast static lint (~10 s) + # ─────────────────────────────────────────────────── lint: - name: Static Lint + name: Tier 1 — Static Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install glslang + - name: Install glslang + python run: | - sudo apt-get update - sudo apt-get install -y glslang-tools python3 + sudo apt-get update -qq + sudo apt-get install -y --no-install-recommends glslang-tools python3 - name: Run lint - run: | - python3 test/tier1-lint/lint.py shaders/ - - # ═══════════════════════════════════════════════════ - # TIER 2 — Iris compatibility matrix - # - # Tests the shader pack against multiple Iris/MC versions. - # Build cost ~3 min per job, parallelized. - # ═══════════════════════════════════════════════════ - iris-matrix: - name: Iris ${{ matrix.iris }} (MC ${{ matrix.mc }}) + run: python3 test/tier1-lint/lint.py shaders/ + + # ─────────────────────────────────────────────────── + # TIER 2 — GLSL validation via Docker shim (~1 min) + # Injects Iris uniforms and validates every .vsh/.fsh + # with glslangValidator — no Minecraft required. + # ─────────────────────────────────────────────────── + glsl-validate: + name: Tier 2 — GLSL Validation needs: lint runs-on: ubuntu-latest - strategy: - # fail-fast=false: test all versions even if one breaks - fail-fast: false - matrix: - include: - # Current stable - - { mc: '1.21.1', iris: '1.7.5', sodium: '0.5.11' } - - { mc: '1.21.1', iris: '1.7.3', sodium: '0.5.10' } - # 1.20.x LTS - - { mc: '1.20.6', iris: '1.7.2', sodium: '0.5.9' } - - { mc: '1.20.4', iris: '1.7.0', sodium: '0.5.8' } - - { mc: '1.20.1', iris: '1.6.17', sodium: '0.5.3' } - # Older but supported - - { mc: '1.19.4', iris: '1.6.4', sodium: '0.4.10' } - - { mc: '1.19.2', iris: '1.6.0', sodium: '0.4.4' } - steps: - uses: actions/checkout@v4 - - name: Build test image + - name: Build validator image run: | - docker build \ - --build-arg MC_VERSION=${{ matrix.mc }} \ - --build-arg IRIS_VERSION=${{ matrix.iris }} \ - --build-arg SODIUM_VERSION=${{ matrix.sodium }} \ - -t iris-test:${{ matrix.iris }} \ - test/tier2-integration/ + docker build -t shader-validator test/tier2-integration/ - - name: Run shader test - id: shader-test - continue-on-error: true + - name: Run GLSL validation run: | docker run --rm \ - -v "${PWD}":/shader-mount:ro \ - -v "${PWD}/test-results":/opt/mctest/logs \ - -e SHADER_NAME=vss-awareness \ - -e TEST_DURATION=45 \ - iris-test:${{ matrix.iris }} - - - name: Upload logs on failure - if: steps.shader-test.outcome == 'failure' - uses: actions/upload-artifact@v4 - with: - name: logs-iris-${{ matrix.iris }}-mc-${{ matrix.mc }} - path: test-results/ - - - name: Annotate result - run: | - if [[ "${{ steps.shader-test.outcome }}" == "success" ]]; then - echo "::notice::Iris ${{ matrix.iris }} (MC ${{ matrix.mc }}) — PASS" - else - echo "::error::Iris ${{ matrix.iris }} (MC ${{ matrix.mc }}) — FAIL" - exit 1 - fi - - # ═══════════════════════════════════════════════════ - # Compatibility matrix summary - # ═══════════════════════════════════════════════════ - matrix-report: - name: Compatibility Report - needs: iris-matrix - if: always() - runs-on: ubuntu-latest - steps: - - name: Generate report - run: | - echo "## Iris Compatibility Matrix" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "| MC | Iris | Status |" >> $GITHUB_STEP_SUMMARY - echo "|----|------|--------|" >> $GITHUB_STEP_SUMMARY - if [[ "${{ needs.iris-matrix.result }}" == "success" ]]; then - echo "| All tested versions | | ✅ Pass |" >> $GITHUB_STEP_SUMMARY - else - echo "| At least one version | | ❌ Fail |" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "See job annotations and artifacts for details." >> $GITHUB_STEP_SUMMARY - fi + -v "$PWD/shaders:/shader-mount/shaders:ro" \ + shader-validator \ + /shader-mount/shaders diff --git a/test/tier2-integration/Dockerfile b/test/tier2-integration/Dockerfile index 9f6e5ec..4ab0a6a 100644 --- a/test/tier2-integration/Dockerfile +++ b/test/tier2-integration/Dockerfile @@ -1,65 +1,16 @@ -# ===================================================== -# Iris Shader Test Container -# Headless Minecraft + Fabric + Iris + Sodium -# + Mesa LLVMpipe (software OpenGL) + Xvfb -# ===================================================== - -FROM eclipse-temurin:21-jdk-jammy - -ARG MC_VERSION=1.21.1 -ARG IRIS_VERSION=1.7.5 -ARG SODIUM_VERSION=mc1.21.1-0.5.11 -ARG FABRIC_LOADER_VERSION=0.16.0 -ARG FABRIC_API_VERSION=0.102.0+1.21.1 -ARG FABRIC_INSTALLER_VERSION=1.0.1 +FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive -ENV DISPLAY=:99 -ENV LIBGL_ALWAYS_SOFTWARE=1 -ENV MESA_GL_VERSION_OVERRIDE=4.5 -# Mesa + Xvfb + tools RUN apt-get update && apt-get install -y --no-install-recommends \ - xvfb \ - libgl1-mesa-dri \ - libglu1-mesa \ - mesa-utils \ - libxi6 \ - libxxf86vm1 \ - libxrandr2 \ - libxcursor1 \ - libxinerama1 \ - ca-certificates \ - curl \ - unzip \ - jq \ + glslang-tools \ + python3 \ + findutils \ && rm -rf /var/lib/apt/lists/* -# Working layout -WORKDIR /opt/mctest -RUN mkdir -p /opt/mctest/mc /opt/mctest/mods /opt/mctest/shaderpacks /opt/mctest/logs - -# Fabric installer — installs headless via server-mode variant -# or client mode with offline tweaks. Here: minimal client. -RUN curl -fSL "https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar" \ - -o /opt/mctest/fabric-installer.jar - -# Iris + Sodium + Fabric API -RUN curl -fSL "https://github.com/IrisShaders/Iris/releases/download/v${IRIS_VERSION}%2Bmc${MC_VERSION}/iris-mc${MC_VERSION}-${IRIS_VERSION}.jar" \ - -o /opt/mctest/mods/iris.jar 2>/dev/null \ - || echo "WARN: Iris download failed for ${IRIS_VERSION}+mc${MC_VERSION} — please adjust the URL manually from Modrinth/GitHub" - -RUN curl -fSL "https://api.modrinth.com/v2/project/sodium/version" \ - | jq -r --arg mc "${MC_VERSION}" '.[] | select(.game_versions[] == $mc) | .files[0].url' \ - | head -1 | xargs -I {} curl -fSL "{}" -o /opt/mctest/mods/sodium.jar 2>/dev/null \ - || echo "WARN: Sodium download via API failed" - -RUN curl -fSL "https://api.modrinth.com/v2/project/fabric-api/version" \ - | jq -r --arg mc "${MC_VERSION}" '.[] | select(.game_versions[] == $mc) | .files[0].url' \ - | head -1 | xargs -I {} curl -fSL "{}" -o /opt/mctest/mods/fabric-api.jar 2>/dev/null \ - || echo "WARN: Fabric API download via API failed" - -COPY entrypoint.sh /opt/mctest/entrypoint.sh -RUN chmod +x /opt/mctest/entrypoint.sh +WORKDIR /opt/shader-test +COPY entrypoint.sh /opt/shader-test/entrypoint.sh +COPY iris-shim.glsl /opt/shader-test/iris-shim.glsl +RUN chmod +x /opt/shader-test/entrypoint.sh -ENTRYPOINT ["/opt/mctest/entrypoint.sh"] +ENTRYPOINT ["/opt/shader-test/entrypoint.sh"] diff --git a/test/tier2-integration/entrypoint.sh b/test/tier2-integration/entrypoint.sh index 96d9c4b..962cd2a 100644 --- a/test/tier2-integration/entrypoint.sh +++ b/test/tier2-integration/entrypoint.sh @@ -1,101 +1,65 @@ #!/usr/bin/env bash -# ===================================================== -# entrypoint.sh -# Starts MC headless with Iris, loads the mounted shader pack, -# and parses latest.log for compile errors. -# ===================================================== +# Tier-2 GLSL validation +# Injects the Iris uniform shim into each .vsh/.fsh and validates with +# glslangValidator. Does not run Minecraft — validates at the GLSL level. set -euo pipefail -SHADER_NAME="${SHADER_NAME:-shader-under-test}" -TEST_DURATION="${TEST_DURATION:-30}" # seconds +SHADER_DIR="${1:-/shader-mount/shaders}" +SHIM="/opt/shader-test/iris-shim.glsl" +PASS=0 +FAIL=0 +ERRORS="" -LOG_DIR=/opt/mctest/logs -mkdir -p "${LOG_DIR}" /opt/mctest/shaderpacks +validate() { + local file="$1" + local stage="$2" # vert or frag + local tmp + tmp=$(mktemp /tmp/shader-XXXXXX.glsl) -# Expects: shader to be mounted at /shader-mount -if [[ ! -d /shader-mount ]]; then - echo "FATAL: no shader mounted at /shader-mount" - exit 2 -fi - -# Copy the pack as a ZIP into shaderpacks -echo "▸ Packing shader to shaderpacks/${SHADER_NAME}.zip" -cd /shader-mount -zip -qr "/opt/mctest/shaderpacks/${SHADER_NAME}.zip" shaders/ -cd /opt/mctest - -# Force the shader pack via iris.properties -mkdir -p /opt/mctest/mc/config -cat > /opt/mctest/mc/config/iris.properties < "$tmp" + if [[ "$stage" == "vert" ]]; then + echo "#define VERTEX_STAGE" >> "$tmp" + fi + cat "$SHIM" >> "$tmp" + grep -v '^#version' "$file" >> "$tmp" -# Start Xvfb -echo "▸ Starting Xvfb (1280x720x24)" -Xvfb :99 -screen 0 1280x720x24 +extension GLX +render -noreset & -XVFB_PID=$! -sleep 2 + local out + if out=$(glslangValidator --stdin -S "$stage" < "$tmp" 2>&1); then + PASS=$((PASS + 1)) + else + FAIL=$((FAIL + 1)) + ERRORS+=$'\n'"[FAIL] $(basename "$file")"$'\n'"$out"$'\n' + fi + rm -f "$tmp" +} -# OpenGL sanity check -echo "▸ OpenGL renderer:" -glxinfo 2>/dev/null | grep -E "OpenGL (vendor|renderer|version)" || echo " (glxinfo unavailable)" - -# Launch Minecraft — option A: Fabric installer client mode -# Note: a full client boot requires MC auth. For CI, use either an -# offline trick via authlib-injector or a Fabric server build that -# triggers only the mod-init path and then exits. -# -# In practice, we recommend writing a small Fabric mod that on the -# CLIENT_STARTED event triggers Iris.getInstance().reloadShader() and -# then calls System.exit(). Mount that mod here. -# -# Fallback: vanilla launcher with an MS auth token from ENV. - -if [[ -z "${MC_OFFLINE_NAME:-}" ]] && [[ -z "${MC_AUTH_TOKEN:-}" ]]; then - echo "▸ No auth — using OFFLINE_NAME=TestBot mode" - export MC_OFFLINE_NAME="TestBot" +if [[ ! -d "$SHADER_DIR" ]]; then + echo "FATAL: shader directory not found at $SHADER_DIR" + exit 2 fi -echo "▸ Starting Minecraft (${TEST_DURATION}s boot window)…" -# The concrete launch command line goes here. Bootstrap differs per -# MC version, so this is a placeholder that must be replaced by a -# concrete mc-launch script. -timeout "${TEST_DURATION}" java \ - -Djava.library.path=/opt/mctest/mc/natives \ - -cp "/opt/mctest/mc/libraries/*:/opt/mctest/mc/versions/*/client.jar" \ - -Xmx2G \ - net.fabricmc.loader.impl.launch.knot.KnotClient \ - --gameDir /opt/mctest/mc \ - --assetsDir /opt/mctest/mc/assets \ - --version "fabric-loader-${MC_VERSION:-unknown}" \ - --username "${MC_OFFLINE_NAME:-TestBot}" \ - --uuid "00000000-0000-0000-0000-000000000000" \ - --accessToken "0" \ - --userType offline \ - > "${LOG_DIR}/mc-stdout.log" 2> "${LOG_DIR}/mc-stderr.log" || true +echo "▸ Validating GLSL in $SHADER_DIR" +echo "" -# Iris log parsing -LATEST_LOG="/opt/mctest/mc/logs/latest.log" -if [[ ! -f "${LATEST_LOG}" ]]; then - echo "WARN: latest.log not found — falling back to stdout" - LATEST_LOG="${LOG_DIR}/mc-stdout.log" -fi +while IFS= read -r -d '' f; do + validate "$f" vert +done < <(find "$SHADER_DIR" -name "*.vsh" -print0) -cp "${LATEST_LOG}" "${LOG_DIR}/" 2>/dev/null || true +while IFS= read -r -d '' f; do + validate "$f" frag +done < <(find "$SHADER_DIR" -name "*.fsh" -print0) -# Extract error patterns -echo "▸ Parsing log for shader errors…" -ERRORS=$(grep -E "(Failed to compile|Shader compilation failed|GLSL.*error|undeclared|Failed to load shader)" \ - "${LATEST_LOG}" 2>/dev/null || true) +echo " passed : $PASS" +echo " failed : $FAIL" -if [[ -n "${ERRORS}" ]]; then - echo "═══ SHADER ERRORS ═══" - echo "${ERRORS}" | tee "${LOG_DIR}/shader-errors.txt" - kill ${XVFB_PID} 2>/dev/null || true +if [[ $FAIL -gt 0 ]]; then + echo "" + echo "═══ GLSL ERRORS ═══" + echo "$ERRORS" exit 1 fi -echo "✓ No shader compile errors in the log." -kill ${XVFB_PID} 2>/dev/null || true +echo "" +echo "✓ All shader files validated." exit 0 diff --git a/test/tier2-integration/iris-shim.glsl b/test/tier2-integration/iris-shim.glsl new file mode 100644 index 0000000..8f18309 --- /dev/null +++ b/test/tier2-integration/iris-shim.glsl @@ -0,0 +1,59 @@ +// Iris uniform shim — injected before each shader file during validation. +// Covers the uniforms and varyings that Iris injects at runtime so +// glslangValidator can resolve all symbols without a live Minecraft instance. + +// ── Time ──────────────────────────────────────────────────────────────────── +uniform float frameTime; +uniform float frameTimeCounter; +uniform int frameCounter; + +// ── Screen / projection ───────────────────────────────────────────────────── +uniform vec2 viewSize; +uniform vec2 texelSize; +uniform mat4 gbufferProjection; +uniform mat4 gbufferProjectionInverse; +uniform mat4 gbufferModelView; +uniform mat4 gbufferModelViewInverse; +uniform mat4 gbufferPreviousProjection; +uniform mat4 gbufferPreviousModelView; + +// ── Camera ─────────────────────────────────────────────────────────────────── +uniform vec3 cameraPosition; +uniform vec3 previousCameraPosition; +uniform float eyeAltitude; +uniform int isEyeInWater; +uniform ivec2 eyeBrightnessSmooth; +uniform ivec2 eyeBrightness; + +// ── World ──────────────────────────────────────────────────────────────────── +uniform float sunAngle; +uniform float rainStrength; +uniform float wetness; +uniform int worldTime; +uniform int worldDay; +uniform int moonPhase; + +// ── Textures (colortex0–7, depth, noise) ──────────────────────────────────── +uniform sampler2D colortex0; +uniform sampler2D colortex1; +uniform sampler2D colortex2; +uniform sampler2D colortex3; +uniform sampler2D colortex4; +uniform sampler2D colortex5; +uniform sampler2D colortex6; +uniform sampler2D colortex7; +uniform sampler2D depthtex0; +uniform sampler2D depthtex1; +uniform sampler2D depthtex2; +uniform sampler2D noisetex; +uniform sampler2D gtexture; +uniform sampler2D lightmap; +uniform sampler2D gaux1; + +// ── Per-fragment inputs (composite / final) ────────────────────────────────── +in vec2 texcoord; + +// ── Per-vertex outputs (vertex shaders) ────────────────────────────────────── +#ifdef VERTEX_STAGE +out vec2 texcoord; +#endif From c8d2bce161e0a5131cf9240dc8eaee27135e5b48 Mon Sep 17 00:00:00 2001 From: TheMeinerLP Date: Sun, 26 Apr 2026 19:39:48 +0200 Subject: [PATCH 2/2] fix: tier-2 shim texcoord redefinition, inline include resolution, manifest to 0.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - iris-shim.glsl: removed texcoord declarations (shaders declare their own varyings; shim was causing redefinition errors in both vert and frag stages) - entrypoint.sh: replaced glslangValidator -I approach with a Python inline preprocessor — glslangValidator treats '/lib/foo' as an absolute system path, not relative to -I, so includes must be resolved before validation - .release-please-manifest.json: initial version set to 0.1.0 --- .release-please-manifest.json | 3 ++ test/tier2-integration/entrypoint.sh | 57 ++++++++++++++++++--------- test/tier2-integration/iris-shim.glsl | 20 ++++------ 3 files changed, 49 insertions(+), 31 deletions(-) create mode 100644 .release-please-manifest.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..466df71 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.0" +} diff --git a/test/tier2-integration/entrypoint.sh b/test/tier2-integration/entrypoint.sh index 962cd2a..8ee02b0 100644 --- a/test/tier2-integration/entrypoint.sh +++ b/test/tier2-integration/entrypoint.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash # Tier-2 GLSL validation -# Injects the Iris uniform shim into each .vsh/.fsh and validates with -# glslangValidator. Does not run Minecraft — validates at the GLSL level. +# Preprocesses #include directives inline (glslangValidator treats "/lib/foo" +# as an absolute system path, not relative to -I), then validates each +# .vsh/.fsh with glslangValidator after injecting the Iris uniform shim. set -euo pipefail SHADER_DIR="${1:-/shader-mount/shaders}" @@ -10,22 +11,45 @@ PASS=0 FAIL=0 ERRORS="" +preprocess() { + # Inline all #include "/lib/..." directives relative to SHADER_DIR, + # strip the file's own #version line. + python3 - "$1" "$SHADER_DIR" <<'PY' +import sys, re, os + +def inline_includes(text, root, depth=0): + if depth > 20: + return text + def sub(m): + rel = m.group(1).lstrip('/') + path = os.path.join(root, rel) + try: + return inline_includes(open(path).read(), root, depth + 1) + except FileNotFoundError: + return f"// [shim] include not found: {path}" + return re.sub(r'^\s*#include\s+"([^"]+)"', sub, text, flags=re.MULTILINE) + +src = open(sys.argv[1]).read() +src = re.sub(r'^#version[^\n]*\n', '', src, flags=re.MULTILINE) +print(inline_includes(src, sys.argv[2])) +PY +} + validate() { local file="$1" - local stage="$2" # vert or frag + local stage="$2" local tmp tmp=$(mktemp /tmp/shader-XXXXXX.glsl) - # Strip existing #version line, prepend shim after our own #version - echo "#version 330 compatibility" > "$tmp" - if [[ "$stage" == "vert" ]]; then - echo "#define VERTEX_STAGE" >> "$tmp" - fi - cat "$SHIM" >> "$tmp" - grep -v '^#version' "$file" >> "$tmp" + { + echo "#version 330 compatibility" + [[ "$stage" == "vert" ]] && echo "#define VERTEX_STAGE" + cat "$SHIM" + preprocess "$file" + } > "$tmp" local out - if out=$(glslangValidator --stdin -S "$stage" < "$tmp" 2>&1); then + if out=$(glslangValidator -S "$stage" "$tmp" 2>&1); then PASS=$((PASS + 1)) else FAIL=$((FAIL + 1)) @@ -42,13 +66,11 @@ fi echo "▸ Validating GLSL in $SHADER_DIR" echo "" -while IFS= read -r -d '' f; do - validate "$f" vert -done < <(find "$SHADER_DIR" -name "*.vsh" -print0) +while IFS= read -r -d '' f; do validate "$f" vert; done \ + < <(find "$SHADER_DIR" -maxdepth 1 -name "*.vsh" -print0) -while IFS= read -r -d '' f; do - validate "$f" frag -done < <(find "$SHADER_DIR" -name "*.fsh" -print0) +while IFS= read -r -d '' f; do validate "$f" frag; done \ + < <(find "$SHADER_DIR" -maxdepth 1 -name "*.fsh" -print0) echo " passed : $PASS" echo " failed : $FAIL" @@ -60,6 +82,5 @@ if [[ $FAIL -gt 0 ]]; then exit 1 fi -echo "" echo "✓ All shader files validated." exit 0 diff --git a/test/tier2-integration/iris-shim.glsl b/test/tier2-integration/iris-shim.glsl index 8f18309..3002830 100644 --- a/test/tier2-integration/iris-shim.glsl +++ b/test/tier2-integration/iris-shim.glsl @@ -1,13 +1,15 @@ // Iris uniform shim — injected before each shader file during validation. -// Covers the uniforms and varyings that Iris injects at runtime so -// glslangValidator can resolve all symbols without a live Minecraft instance. +// Only uniforms that Iris injects at runtime. Varyings (texcoord etc.) are +// declared by the shader files themselves — do NOT redeclare them here. -// ── Time ──────────────────────────────────────────────────────────────────── +#extension GL_GOOGLE_include_directive : enable + +// ── Time ───────────────────────────────────────────────────────────────────── uniform float frameTime; uniform float frameTimeCounter; uniform int frameCounter; -// ── Screen / projection ───────────────────────────────────────────────────── +// ── Screen / projection ────────────────────────────────────────────────────── uniform vec2 viewSize; uniform vec2 texelSize; uniform mat4 gbufferProjection; @@ -33,7 +35,7 @@ uniform int worldTime; uniform int worldDay; uniform int moonPhase; -// ── Textures (colortex0–7, depth, noise) ──────────────────────────────────── +// ── Textures ───────────────────────────────────────────────────────────────── uniform sampler2D colortex0; uniform sampler2D colortex1; uniform sampler2D colortex2; @@ -49,11 +51,3 @@ uniform sampler2D noisetex; uniform sampler2D gtexture; uniform sampler2D lightmap; uniform sampler2D gaux1; - -// ── Per-fragment inputs (composite / final) ────────────────────────────────── -in vec2 texcoord; - -// ── Per-vertex outputs (vertex shaders) ────────────────────────────────────── -#ifdef VERTEX_STAGE -out vec2 texcoord; -#endif