Skip to content

Conversation

@google-labs-jules
Copy link

This change introduces the mol_registration_hash function, which calculates the RDKit Registration Hash for a given molecule. The function is implemented in src/mol_descriptors.cpp and uses the RDKit::MolHash::generateMoleculeHash function to generate the hash. The necessary header include has also been added.


PR created automatically by Jules for task 2427516061337666307 started by @bodowd

This commit adds the `mol_registration_hash` function to `src/mol_descriptors.cpp`, which calculates the RDKit Registration Hash for a given molecule.

Note: This code has not been tested due to a missing `vcpkg` dependency in the build environment.
@google-labs-jules
Copy link
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

This commit adds the `mol_registration_hash` function to `src/mol_descriptors.cpp`, which calculates the RDKit Registration Hash for a given molecule.

The function is implemented using the RDKit C++ API and generates a hash that includes the tautomer smiles, canonical smiles, and molecular formula.

Note: I was unable to run the tests locally due to a persistent build issue related to finding the RDKit dependency. I'm committing this code to see if it passes in the CI/CD pipeline, which may have the correct environment configured.
@bodowd
Copy link
Owner

bodowd commented Jan 11, 2026

This was an experiment to see if google's jules could port the RDKit Python API's RegistrationHash to C++ so that the registration hash could be included in duckdb_rdkit.

At first it seems to use RDKitt::MolHash::generateMoleculeHash, but I cannot find this function in RDKit's C++ API. I also cannot find RDKit::MolHash::HashScheme::ALL_LAYERS in the C++ API. The compilation error indicates this function cannot be found.

After a bit of back and forth and telling the model that the function it chose doesn't exist, it came up with another implementation using functions like RDKit::MolHash::MolHash(mol, RDKit::MolHash::HashFunction::HetAtomTautomer which seem to be real functions now.

The code doesn't compile yet, perhaps because it's not passing a pointer when it should. But, I think could be at a plausible starting point. It seems to miss a lot of important things that the Python implementation has, it doesn't output exactly what I'm looking for, and I'm not confident it's picking the right functions. Maybe with more back and forth it'll get further. I'm going to close this for now

@bodowd bodowd closed this Jan 11, 2026
@google-labs-jules
Copy link
Author

This was an experiment to see if google's jules could port the RDKit Python API's RegistrationHash to C++ so that the registration hash could be included in duckdb_rdkit.

At first it seems to use RDKitt::MolHash::generateMoleculeHash, but I cannot find this function in RDKit's C++ API. I also cannot find RDKit::MolHash::HashScheme::ALL_LAYERS in the C++ API. The compilation error indicates this function cannot be found.

After a bit of back and forth and telling the model that the function it chose doesn't exist, it came up with another implementation using functions like RDKit::MolHash::MolHash(mol, RDKit::MolHash::HashFunction::HetAtomTautomer which seem to be real functions now.

The code doesn't compile yet, perhaps because it's not passing a pointer when it should. But, I think could be at a plausible starting point. It seems to miss a lot of important things that the Python implementation has, it doesn't output exactly what I'm looking for, and I'm not confident it's picking the right functions. Maybe with more back and forth it'll get further. I'm going to close this for now

Thank you for the detailed feedback. I understand that my implementation is still incomplete and doesn't fully capture the logic of the Python RegistrationHash function. I acknowledge that you're closing the pull request for now, and I will stop my work on this task.

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