-
Notifications
You must be signed in to change notification settings - Fork 0
Cherry-pick critical bug fixes from upstream PR #66 and add PR preview deployment #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: ap0ught <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR cherry-picks critical bug fixes from upstream PR #66 while maintaining the fork's static web app architecture. The changes focus on fixing WebGPU texture dimension safety, improving animation timing precision, and correcting mouse event handling in mirror effects.
Key Changes
- Fixed potential WebGPU crashes by enforcing minimum texture dimensions in bloom passes
- Replaced
Date.now()withperformance.now()for more accurate animation timing - Corrected mouse click coordinate calculations to account for canvas positioning
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| js/webgpu/mirrorPass.js | Moved event handlers inside effect scope, fixed click coordinates, and improved timing precision |
| js/webgpu/main.js | Added canvas parameter to mirror pass context |
| js/webgpu/bloomPass.js | Added safety checks to prevent zero-sized textures and dispatch dimensions |
| js/regl/mirrorPass.js | Fixed REGL array uniform bug, corrected click coordinates, and improved timing |
| js/regl/main.js | Added canvas parameter to REGL context |
|
@copilot how can I test this out on https://ap0ught.github.io/matrix without deploying to master |
You can test this PR branch on GitHub Pages in several ways: Option 1: Use a branch-specific URL (if gh-pages is deployed from branches) However, this repository appears to deploy from the master branch only. Option 2: Create a temporary deployment workflow Option 3: Local testing (recommended) git fetch origin copilot/merge-upstream-pr-66
git checkout copilot/merge-upstream-pr-66
python3 -m http.server 8000
# Open http://localhost:8000/?suppressWarnings=trueOption 4: Use GitHub Codespaces or Gitpod Option 5: Deploy to Netlify/Vercel preview Which approach would you prefer? I can implement Option 2 if you'd like automated PR preview deployments. |
|
@copilot ### implement Option 2 |
Co-authored-by: ap0ught <[email protected]>
I've implemented the PR preview deployment workflow in commit 7a41e2d. What Was Added
How to TestThe workflow will automatically run when this PR is updated. You can also manually trigger it:
After deployment completes (~30 seconds), the PR will be available at:
A bot comment will be posted with convenient test links for different Matrix versions. NoteGitHub Pages needs to be enabled with the |
|
@copilot Please find a solution for failing job 52172443811. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate. |
Co-authored-by: ap0ught <[email protected]>
Fixed the workflow authentication issues in commit 795f94c. Root CauseThe workflow was failing because:
SolutionUpdated
token: ${{ github.token }}
git remote add origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git"
if ! git remote get-url origin | grep -q "x-access-token"; then
git remote set-url origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git"
fiThe workflow should now successfully:
You can manually trigger the workflow again from the Actions tab to test the fix. |
|
@copilot Please find a solution for failing job 52182530909. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate. |
Co-authored-by: ap0ught <[email protected]>
Fixed workflow robustness issues in commit 3f3d24e. Root CausesThe workflow was likely failing due to:
SolutionUpdated 1. Better gh-pages detection: if [ ! -d "gh-pages/.git" ]; then
# Initialize new branch with proper setup2. Complete initialization: git add .
git commit -m "Initialize gh-pages branch"3. Configuration for existing branches: else
echo "gh-pages branch exists, configuring..."
cd gh-pages
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"4. Reliable checkout: ref: ${{ github.event.pull_request.head.sha || github.sha }}5. Conditional deployment: if git diff --staged --quiet; then
echo "No changes to deploy"
else
git commit -m "Deploy preview: ${{ steps.preview.outputs.path }}"
git push origin gh-pages --force6. Improved remote configuration: git remote set-url origin "..." || git remote add origin "..."The workflow should now handle both first-time setup and subsequent deployments reliably. You can re-run the workflow to test. |
Summary
Cherry-picked critical bug fixes from upstream PR #66 (Rezmason#66) while maintaining compatibility with the static web app architecture, and added automated PR preview deployment infrastructure.
Changes Applied
WebGPU Bloom Pass (js/webgpu/bloomPass.js)
Math.max(1, ...)to pyramid texture creation and dispatch sizesMirror Pass - Both Renderers (js/webgpu/mirrorPass.js, js/regl/mirrorPass.js)
Date.now()toperformance.now()for more accurate timinggetBoundingClientRect()instead of direct client dimensionswindow.onclicktocanvas.onmousedownfor better event handlingREGL-specific Fix (js/regl/mirrorPass.js)
clicks: () => clicksto["clicks[0]"]: () => clicks[0]patternContext Updates (js/webgpu/main.js, js/regl/main.js)
canvasparameter to context objects to support mirror pass canvas event bindingPR Preview Deployment
https://ap0ught.github.io/matrix/pr-{number}/.github/PR_PREVIEW.mdWorkflow Improvements (Latest)
Enhanced the PR preview workflow with better error handling:
.gitdirectory to properly detect gh-pages checkout statusTesting
✅ Default Matrix effect renders correctly
✅ Mirror effect works with improved mouse handling
✅ 3D volumetric mode functions properly
✅ No JavaScript errors in console
✅ All code formatted with Prettier
✅ Workflow YAML validated
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.