Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: palmje
Differential Revision: D53779537
fbshipit-source-id: 698cdc6720c10d219e56ecd2aad8f4cbe636c639
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: palmje
Differential Revision: D53779541
fbshipit-source-id: 7184c46a38d126debaebbda40aedcb4e9a048040
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: palmje
Differential Revision: D53779571
fbshipit-source-id: 008ce210aee7eb8668587cb40154563ada0172db
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: palmje
Differential Revision: D53779472
fbshipit-source-id: 0efad740e4741950ee023ac77c4ca8c2f0d03c61
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: palmje
Differential Revision: D53779599
fbshipit-source-id: 7f872cecdff078681748d18dfdea78e361a9a72f
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: palmje
Differential Revision: D53779512
fbshipit-source-id: 038967a05306d921cc09f48ae71b4e6d4eda6664
Summary:
`-Wextra-semi` or `-Wextra-semi-stmt` found an extra semi
If the code compiles, this is safe to land.
Reviewed By: palmje, dmm-fb
Differential Revision: D53776211
fbshipit-source-id: c256f5197537251bbe0f583869089b3035a8ee77
Summary:
libraft 24.02 is now in the main channel of rapidsai (and no longer in the nightly), switching channel we build against to prepare for the release of faiss-gpu-raft
cmake build will continue to use the nightly, but the conda packages will be built against the release
Reviewed By: mlomeli1
Differential Revision: D53712646
fbshipit-source-id: de60c3336e6a199b496fc3829d71a778e5ea8cbd
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3247
add a context parameter to be passed to InvertedLists and InvertedListsIterator.
- add a context field in `SearchParametersIVF`, the context will be passed to `InvertedLists::get_iterator`. The user can create `InvertedListsIterator` with the context object
- add a context parameter in `IndexIVF::add_core` method. the context will be passed to `InvertedLists::add_entry`.
The user can use the context object to pass storage handlers, store error codes from storage layer, logging information, etc.
Reviewed By: mdouze
Differential Revision: D53113911
fbshipit-source-id: ff31d247d3dc949d0bb50bcaffc3142efd027089
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3248
Build scripts can't find conda in the 'stable' image, trying to pin to a specific version.
Reviewed By: mlomeli1
Differential Revision: D53608347
fbshipit-source-id: 3f7c350608afc9c253cf0153e37ceeb4fceca92c
Summary:
Considering that only GPU classic works on Pascal and only if compiled with cuda 11.4, this sets up the conda builds as follows.
tl;dr: Pascal will only be supported by faiss-gpu on cuda 11.
## faiss-gpu
1. build on cuda 11.4.4, supports Pascal, works with pytorch-cuda=11 (including hosts with cuda 12 drivers)
2. build on cuda 12.1.1, does NOT support Pascal, works with pytorch-cuda=12
## faiss-gpu-raft
1. build on cuda 11.8.0, does NOT support Pascal, works with pytorch-cuda=11.8
2. build on cuda 12.1.1, does NOT support Pascal, works with pytorch-cuda=12
The reason faiss-gpu-raft is built with and supports only 11.8 is due to the risk of clobbering otherwise between libraft and pytorch-cuda dependencies.
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3237
Reviewed By: mdouze
Differential Revision: D53354121
Pulled By: algoriddle
fbshipit-source-id: 86108e975168759572f84922bf0ccef55ae75ef8
Summary:
I found that HNSW search method uses its own efSearch to create candidates, which should be got from params if provided I think?
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3233
Reviewed By: algoriddle
Differential Revision: D53342879
Pulled By: mdouze
fbshipit-source-id: 4f47f19d3673d1bb8d7e8e82745f9e5c1b9afb42
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3154
Using the benchmark to find Pareto optimal indices, in this case on BigANN as an example.
Separately optimize the coarse quantizer and the vector codec and use Pareto optimal configurations to construct IVF indices, which are then retested at various scales. See `optimize()` in `optimize.py` as the main function driving the process.
The results can be interpreted with `bench_fw_notebook.ipynb`, which allows:
* filtering by maximum code size
* maximum time
* minimum accuracy
* space or time Pareto optimal options
* and visualize the results and output them as a table.
This version is intentionally limited to IVF(Flat|HNSW),PQ|SQ indices...
Reviewed By: mdouze
Differential Revision: D51781670
fbshipit-source-id: 2c0f800d374ea845255934f519cc28095c00a51f
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: algoriddle
Differential Revision: D52981077
fbshipit-source-id: ad164f9fbe267c6f594f9298132578f0a3805a2c
Summary:
1. Split the GPU code into a separate static library to reduce build times.
2. faiss-gpu now depends on pytorch-cuda to stop clobbering of CUDA libraries when Faiss and Pytorch installed in the same environment
3. Add CUDA 12 (we support both 11.8 and 12.1)
4. Add Python 3.12
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3222
Reviewed By: mlomeli1
Differential Revision: D53215033
Pulled By: algoriddle
fbshipit-source-id: d48c5707af20b7e5ff72c3aa27b0e677259f22f8
Summary:
Fixes#3156
Metamate says: "This diff fixes an ACCESS VIOLATION error that occurs when searching using IDSelectorArray. The code changes include adding a new parameter to the knn_inner_products_by_idx and knn_L2sqr_by_idx functions in the distances.cpp file, as well as modifying the test_search_params.py file to test the bounds of the IDSelectorArray."
Reviewed By: mdouze
Differential Revision: D53185461
fbshipit-source-id: c7ec4783f77455684c078bba3aace160078f6c27
Summary:
`-Wextra-semi` or `-Wextra-semi-stmt`
If the code compiles, this is safe to land.
Reviewed By: algoriddle
Differential Revision: D52969139
fbshipit-source-id: 563843d43c64fb988ff0d08ccdb0408cd0eba454
Summary: `-Wunused-function` has identified an unused function. This diff removes it. In many cases these functions have existed for years in an unused state.
Reviewed By: algoriddle
Differential Revision: D53049745
fbshipit-source-id: aa6d9fa5b3ac93c777dd9a5ca239312d1a188a1c
Summary:
The current CMakeList.txt misses a few header files. This PR adds these missing files.
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3218
Reviewed By: mlomeli1
Differential Revision: D53081725
Pulled By: algoriddle
fbshipit-source-id: 94531b39350f6d5b9f8c1bedbb1286f265e99a09
Summary: This diff replaces the use of pickle serialization with json to address a security vulnerability. Adding a warning message that this code is for demonstration purposes only.
Reviewed By: mdouze
Differential Revision: D52777650
fbshipit-source-id: d9d6a00fd341b29ac854adcbf675d2cd303d2f29
Summary: `-Wunused-function` has identified an unused function. This diff removes it. In many cases these functions have existed for years in an unused state.
Reviewed By: palmje
Differential Revision: D53049728
fbshipit-source-id: b3d6b98e4ef035f257e9120369b0e70b3200bec0
Summary:
`-Wextra-semi` or `-Wextra-semi-stmt`
If the code compiles, this is safe to land.
Reviewed By: algoriddle
Differential Revision: D52968923
fbshipit-source-id: 5754c0b17b46bc90d0f05d66bbfacb24fee5caae
Summary:
`-Wextra-semi` or `-Wextra-semi-stmt`
If the code compiles, this is safe to land.
Reviewed By: algoriddle
Differential Revision: D52969102
fbshipit-source-id: f6e4992783a2a1ab0598bf96c664da950e5bba5d
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.
This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.
**What's a shadowed variable?**
Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.
This diff fixes such an issue by renaming the variable.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: algoriddle
Differential Revision: D52959038
fbshipit-source-id: 2b688a08710ff60aea0fea9d8be34f3c1f524f85
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.
This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.
**What's a shadowed variable?**
Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.
This diff fixes such an issue by renaming the variable.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: algoriddle
Differential Revision: D52959180
fbshipit-source-id: 90f735f65f1306c817d80c99c8a2108aee7c599a
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.
This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.
**What's a shadowed variable?**
Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.
This diff fixes such an issue by renaming the variable.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: algoriddle
Differential Revision: D52958916
fbshipit-source-id: 408f0cc2c4687ef812b62631d708f2633754df69
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.
This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.
**What's a shadowed variable?**
Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.
This diff fixes such an issue by renaming the variable.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: algoriddle
Differential Revision: D52959071
fbshipit-source-id: c71b331f9a1ee214cfef8143fdd41c336284d8a2
Summary:
When `FAISS_OPT_LEVEL=avx512`, the current default target omits the `avx2` build, which conflicts with the install targets that specify both `avx2` and `avx512` builds. This PR fixes the default build targets for AVX512.
Install targets:
e19de27d72/faiss/CMakeLists.txt (L332)
With this PR, cmake can build and install without any error.
```bash
cmake -B build -DFAISS_OPT_LEVEL=avx512 .
cmake --build build --config Release -j
cmake --install build
```
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3214
Reviewed By: mlomeli1
Differential Revision: D52996716
Pulled By: algoriddle
fbshipit-source-id: b8a46eee6cc15c2043a1a74c5e15d7a606e94acc
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: bunnypak, dmm-fb
Differential Revision: D53011673
fbshipit-source-id: 011204944fdc48627a34e1358833fc525dcc2c28
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: bunnypak, dmm-fb
Differential Revision: D53011679
fbshipit-source-id: 90cdfb645d66e155b3de853dfab7586a8c720465
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: bunnypak, dmm-fb
Differential Revision: D53011658
fbshipit-source-id: a8ba9102751def7a584167c3f50e4d02e9e6442c
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.
This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.
**What's a shadowed variable?**
Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.
This diff fixes such an issue by renaming the variable.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: dmm-fb
Differential Revision: D52959118
fbshipit-source-id: f3b44eb294ae534ebebfcb7d2da4cd70e259eaa3
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.
This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.
**What's a shadowed variable?**
Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.
This diff fixes such an issue by renaming the variable.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: dmm-fb
Differential Revision: D52959009
fbshipit-source-id: 4842fdae7c20105746660304b3c04d20066c70ae
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: algoriddle
Differential Revision: D52981042
fbshipit-source-id: 6748dc957a26a6b5dec3922505c18a1996e3a002
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: algoriddle
Differential Revision: D52981034
fbshipit-source-id: 0315bb594a2dfaa059132b5f4e41855a4e15034b
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: algoriddle
Differential Revision: D52981052
fbshipit-source-id: 203e7ead56c69ffd77ee4a61eed1d0a502a14866
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: algoriddle
Differential Revision: D52981028
fbshipit-source-id: dbdf5c56e1d594e534183483c236ed2f08f98857
Summary:
`-Wextra-semi` or `-Wextra-semi-stmt`
If the code compiles, this is safe to land.
Reviewed By: algoriddle
Differential Revision: D52969081
fbshipit-source-id: d728a4887ac1415ae88dae643055380a183c6990
Summary:
`-Wextra-semi` or `-Wextra-semi-stmt`
If the code compiles, this is safe to land.
Reviewed By: algoriddle
Differential Revision: D52969138
fbshipit-source-id: bdde568b9bc6f4cc650e131a471a41f6bc2f3f95
Summary:
`-Wextra-semi` or `-Wextra-semi-stmt`
If the code compiles, this is safe to land.
Reviewed By: algoriddle
Differential Revision: D52965948
fbshipit-source-id: e24e38ecbb7e0c957b024a1ae7b2ec94d2fa0adf
Summary:
`-Wextra-semi` or `-Wextra-semi-stmt`
If the code compiles, this is safe to land.
Reviewed By: algoriddle
Differential Revision: D52969076
fbshipit-source-id: 97692db6dd7a2d6ffef12ebcdaadd99abf089ca1
Summary:
`-Wextra-semi` or `-Wextra-semi-stmt`
If the code compiles, this is safe to land.
Reviewed By: algoriddle
Differential Revision: D52969085
fbshipit-source-id: f532f9000abd580e53159f660f6703dacb02796f
Summary:
Raft conda packages are built with conda-forge, which ships a newer version of swig, which broke the build. I'm pinning the version as a zero-effort attempt to fix this.
```
[ 80%] Building CXX object CMakeFiles/swigfaiss.dir/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx.o
/home/circleci/miniconda/conda-bld/faiss-pkg_1705881814815/work/_build_python_3.9/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx: In function 'PyObject* swig_ptr(PyObject*)':
/home/circleci/miniconda/conda-bld/faiss-pkg_1705881814815/work/_build_python_3.9/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx:6573:41: error: 'SWIGTYPE_p_unsigned_long_long' was not declared in this scope; did you mean 'SWIGTYPE_p_unsigned_long'?
6573 | return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_long_long, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/circleci/miniconda/conda-bld/faiss-pkg_1705881814815/work/_build_python_3.9/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx:1136:94: note: in definition of macro 'SWIG_NewPointerObj'
1136 | #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
| ^~~~
/home/circleci/miniconda/conda-bld/faiss-pkg_1705881814815/work/_build_python_3.9/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx:6580:41: error: 'SWIGTYPE_p_long_long' was not declared in this scope; did you mean 'SWIGTYPE_p_MapLong2Long'?
6580 | return SWIG_NewPointerObj(data, SWIGTYPE_p_long_long, 0);
| ^~~~~~~~~~~~~~~~~~~~
/home/circleci/miniconda/conda-bld/faiss-pkg_1705881814815/work/_build_python_3.9/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx:1136:94: note: in definition of macro 'SWIG_NewPointerObj'
1136 | #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
| ^~~~
make[3]: *** [CMakeFiles/swigfaiss.dir/build.make:76: CMakeFiles/swigfaiss.dir/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx.o] Error 1
```
Reviewed By: mlomeli1
Differential Revision: D52962236
fbshipit-source-id: e1a6b4c6ba03c9a0a320b5dbb54a8d618b8f8e74
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.
This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.
**What's a shadowed variable?**
Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.
This diff fixes such an issue by renaming the variable.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: dmm-fb
Differential Revision: D52582793
fbshipit-source-id: 2941630671d99de39c19cfc5d24b2e27e495c171