Skip to content

GPU Kalman Filter Implementation#20

Open
spvio wants to merge 2 commits into
mainfrom
kalman_filter
Open

GPU Kalman Filter Implementation#20
spvio wants to merge 2 commits into
mainfrom
kalman_filter

Conversation

@spvio
Copy link
Copy Markdown

@spvio spvio commented Nov 30, 2025

Files Added

  • kernels/kalman_filter.comp

Files Modified

  • kernels/CMakeLists.txt
  • photon/parse/CMakeLists.txt
  • photon/parse/parse.hpp
  • photon/parse/parse.cpp
  • photon/engine/main.cpp

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @spvio, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request lays the groundwork for a GPU-accelerated Kalman Filter, aiming to leverage parallel processing for improved performance. It involves adding a new compute shader kernel and updating build configurations. While the core GPU kernel file is being introduced, the provided patch also includes a commented-out section of GLSL-like code within a C++ parsing file, suggesting initial exploration or temporary storage of GPU-related logic.

Highlights

  • GPU Kalman Filter Initiative: This pull request initiates the implementation of a GPU-accelerated Kalman Filter, with a new compute shader file (kernels/kalman_filter.comp) being added to house the GPU kernel logic.
  • Placeholder GLSL Code: A substantial block of commented-out GLSL-like code, appearing to be a draft for GPU matrix operations (possibly Cholesky decomposition), has been added to photon/parse/parse.cpp. This code serves as a temporary placeholder or conceptual outline.
  • Build System Updates: The CMake build configurations for both the kernels/ and photon/parse/ directories are being updated to properly integrate the new GPU kernel and any related parsing or engine modifications.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a GPU Kalman Filter. My review of photon/parse/parse.cpp found a couple of issues. There's a duplicated header include which should be removed. More significantly, a large block of commented-out code has been added. This code should be removed to maintain codebase clarity, as version control is the proper place for historical or experimental code. The commented code also contains some internal issues like an unprofessional comment and undefined variables, reinforcing the recommendation for its removal.

Comment thread photon/parse/parse.cpp Outdated
Comment on lines +3 to +4
/*[λ] the photon parsing interface*/
#include "parse.hpp"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

These lines are a duplicate of the first two lines of the file. This redundant include should be removed to keep the code clean.

Comment thread photon/parse/parse.cpp Outdated
Comment on lines +7 to +40
// layout(local_size_x = 4) in; // 4 threads, one per row

// // Input
// layout(binding = 0) buffer InputMatrix {
// float A[16];
// };

// layout(binding = 1) buffer OutputMatrix {
// float L[16];
// };

// void main() {
// uint row = gl_GlobalInvocationID.x; // Thread-per-row!!


// const uint N = 4;

// for (uint col = 0; col < N; col++) {

// if (row < col) {

// }

// if (row == col) {
// // Diagonal shii element
// L[row * N + col] = sqrt(A[row * N + col] - sum);
// }
// else {

// L[row * N + col] = (A[row * N + col] - sum) / L[col * N + col];
// }
// barrier(); // Synchronize? threads in this workgroup
// }
// } No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This large block of commented-out code should be removed. Code that is not in use should not be kept in comments, as it clutters the codebase and can be confusing for future developers. Version control is the appropriate tool for managing code history and experiments.

Furthermore, the commented code contains a comment on line 31 (// Diagonal shii element) that should be phrased more professionally, and it also uses an undefined variable sum.

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.

1 participant