sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Building extensions with CMake
Labels: module: build,module: cpp-extensions,triaged,enhancement,needs design

### 🐛 Describe the bug

Building a non-trivial extension with cmake currently runs into several problems that need to be worked around:
1) Requesting the Torch package from cmake messes up the cuda architectures: After
`find_package(Torch REQUIRED CONFIG)`, the value of `CMAKE_CUDA_ARCHITECTURES` no longer matches what is supplied, e.g., via command line or environment variable. This can be problematic for CI/wheel building, when you want to be able to run the extension also on different GPUs than the one present on the compilation machine.

2) I think the provided cmake target `torch` is sufficient for building c/c++ extensions, but may fail to link for extensions that are to be loaded into python. It seems that `libtorch_python` is not linked as part of the `torch` target.
If this is intended behaviour (to keep things minimal), I would suggest adding a second target, say `torch_python`, that should be linked for extensions intended for python consumption.

For reference, here is the set of workarounds I'm currently using to compile a torch extensions:
```cmake
find_package(Python3 COMPONENTS Interpreter REQUIRED)

execute_process(
        COMMAND "${Python3_EXECUTABLE}" "-c" "import torch;print(torch.utils.cmake_prefix_path)"
        OUTPUT_VARIABLE PT_CMAKE_PREFIX
        COMMAND_ECHO STDOUT
        OUTPUT_STRIP_TRAILING_WHITESPACE
        COMMAND_ERROR_IS_FATAL ANY
)

# cache CUDA_ARCHITECTURES, which seems to be reset by Torch
set(TMP_STORE_CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}")

set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH};${PT_CMAKE_PREFIX})
find_package(Torch REQUIRED CONFIG)

set(CMAKE_CUDA_ARCHITECTURES ${TMP_STORE_CUDA_ARCHITECTURES})

# this shared library isn't linked with the default `torch` target, but it is required because
# the symbol _ZN8pybind116detail11type_casterIN2at6TensorEvE4loadENS_6handleEb is needed.
cmake_path(REPLACE_FILENAME TORCH_LIBRARY libtorch_python.so OUTPUT_VARIABLE LIBTORCH_PYTHON)
target_link_libraries(torch INTERFACE ${LIBTORCH_PYTHON})
```

### Versions

I am currently traveling and cannot access the machine I ran the compile jobs on, and will update this section once I'm back.

cc @malfet @seemethere @zou3519
Repository: vscode
Issue: Extension support for Task Icons
Labels: feature-request,tasks

It would be great to be able to add custom task icons to extension-configured tasks.
I think it'd looks something like this:
<img width="291" alt="image" src="https://github.com/microsoft/vscode/assets/31675041/908b8310-bf97-47f2-9685-3e1fce7b001a">

I noticed that typing this doesn't currently give a warning, but also doesn't work.
Repository: go
Issue: x/mobile: embedding library on iOS build fails. Undefined symbols: Linker command failed with exit code 1
Labels: NeedsInvestigation,mobile

I am trying to embed `librclone` library in my iOS Flutter project. 
It binds using gomobile just fine, however after I include in the Xcode project, build fails with:
```
Undefined symbols:
Linker command failed with exit code 1 (use -v to see invocation)
```

also the resulting ld output doesn't look healthy
```
# ld ios/Gomobile.xcframework/ios-arm64/Gomobile.framework/Gomobile
ld: warning: platform not specified
ld: warning: -arch not specified
ld: warning: No platform min-version specified on command line
ld: warning: ignoring file Gomobile, file is universal (arm64) but does not contain the unknown architecture: Gomobile
Undefined symbols for architecture unknown:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture unknown
```

```
# file ios/Gomobile.xcframework/ios-arm64/Gomobile.framework/Gomobile
Gomobile: Mach-O universal binary with 1 architecture: [arm64:current ar archive]
Gomobile (for architecture arm64):	current ar archive
```

## Reproducible steps
```
cd /tmp
git clone https://github.com/rclone/rclone.git
cd rclone
git checkout v1.65.0

# Apply some iOS fixes that hasn't landed to master yet
git remote add patch https://github.com/imWildCat/rclone.git
git fetch patch
git cherry-pick db1fa117b87fcf5d1c80aca603d6637b9b9baacb

go install golang.org/x/mobile/cmd/gobind@latest
go install golang.org/x/mobile/cmd/gomobile@latest
env PATH=$PATH:~/go/bin gomobile init
# target either ios or iossimulator
env PATH=$PATH:~/go/bin gomobile bind -v -target=ios ./librclone/gomobile

ld Gomobile.xcframework/ios-arm64/Gomobile.framework/Gomobile
```

In order to include the generated project I've used these steps:
https://go.dev/wiki/Mobile#building-and-deploying-to-ios-1
also tried couple more from:
https://medium.com/@matryer/tutorial-calling-go-code-from-swift-on-ios-and-vice-versa-with-gomobile-7925620c17a4

### Framework Search Paths
Since my `librclone` library is located at: `~/myproject/ios/Gomobile.xcframework` which is outside of the iOS Runner `~myproject/ios/Runner/AppDelegate.swift` I've added: `${PROJECT_DIR}/..` to Framework Search Paths

### Bitcode
I've got `ENABLE_BITCODE` set to `NO`

### Versions

go version
```
go version go1.21.5 darwin/arm64
```

sw_vers
```
ProductName:		macOS
ProductVersion:		14.1.1
BuildVersion:		23B81
```

xcode
```
XCode Version 15.1 (15C65)
```

gomobile version
```
gomobile version unknown: binary is out of date, re-install it
```

Not sure why `gomobile version` returns such a version tag. It's freshly installed using: `go install golang.org/x/mobile/cmd/gomobile@latest`


I would appreciate if you could help me to narrow down where the potential issue might be.

Related: https://github.com/golang/go/issues/37241
Repository: flutter
Issue: Use SurfaceHolder.Callback2 
Labels: platform-android,engine,P2,team-android,triaged-android

https://developer.android.com/reference/android/view/SurfaceHolder.Callback2

If we use the `surfaceRedrawNeeded`, we can synchronously block and not need the hack here:

https://github.com/flutter/engine/blob/d9fc7f02104b2bf04301b07c5d1c2cd0fe2421d1/shell/platform/android/io/flutter/embedding/android/FlutterSurfaceView.java#L138-L140

And

https://github.com/flutter/engine/blob/d9fc7f02104b2bf04301b07c5d1c2cd0fe2421d1/shell/platform/android/io/flutter/embedding/android/FlutterSurfaceView.java#L87-L88

/cc @johnmccutchan fyi
Repository: go
Issue: x/build: LUCI windows-amd64-longtest TryBot is slow
Labels: Builders,NeedsInvestigation

```
#!watchflakes
post <- builder ~ `(gotip|go1\.\d\d)-windows-amd64-longtest` && (`test timed out` || `SIGQUIT` || `context deadline exceeded` || status == "ABORT")
```

### Go version

5647578230cab57e3befb9a736b045063e0156b5

### What operating system and processor architecture are you using (`go env`)?

```shell
N/A
```


### What did you do?

Add a `gotip-windows-amd64-longtest` LUCI Trybot on https://go.dev/cl/550237.

### What did you expect to see?

Test results in 15 minutes or less, per https://github.com/golang/go/issues/37439#issuecomment-723413000.

### What did you see instead?

Testing on `gotip-windows-amd64-longtest` took 26½ minutes (http://ci.chromium.org/b/8761608988288421329).

Perhaps the builder sharding needs to be adjusted? (Maybe there are differences in machine speed or load that cause the LUCI builders to be slower than the legacy TryBots?)
Repository: vscode
Issue: Keyboard shortcuts should flash corresponding menubar command's menu
Labels: bug

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.85.1
- OS Version: macOS 13.2.1

On macOS, a shortcut that is mapped to a command in the menubar should cause that command's menu to flash when used.

This is behavior that occurs in all the apps I happened to have open just now (Sublime, Chrome, Slack, Finder, Spotify, Fantastical, Obsidian, and Terminal.app)

Steps to Reproduce:

1. Select some text within the editor
2. Press <kbd>⌘/Cmd</kbd>+<kbd>C</kbd>, for Copy
3. Expect the Edit app menu to flash

Instead, it does not flash.
Repository: node
Issue: Define certificate creation facilities
Labels: crypto,feature request,never-stale

### What is the problem this feature will solve?

Right now, there is a gap in the `crypto` package in that, while one can parse existing certificates (e.g., `new X509Certificate(...)`), there's no exposed built-in functionality (that I could find) to create new certificates with specified properties.

This feature will close that gap.

### What is the feature you are proposing to solve the problem?

Add new classes and/or methods to `node:crypto`, so that one can create a signed certificate from its various parts, along with a signing key, CSR, etc.


### What alternatives have you considered?

I am currently using the npm package `pem` for this, which is a thin wrapper around call-outs to the `openssl` binary (which it assumes is available in the environment).

The npm package`node-forge` seems to have the right functionality and is JS-native, though it is unclear how well-maintained it is.
Repository: pytorch
Issue: AOT inductor should generate source code instead of a library
Labels: feature,triaged,oncall: pt2,module: inductor,oncall: export,module: aotinductor

### 🚀 The feature, motivation and pitch

AOT inductor looks like the upcoming means to do inference from native code that was trained in pytorch, and the replacement for torchcript export to native code. It's clear this interface is in [prototype status](https://github.com/pytorch/pytorch/blob/main/docs/source/torch.compiler_aot_inductor.rst), but based on what is present right now, it's problematic for many users. 

torch._export.aot_compile, as currently defined, produces a .so and presumably invokes nvcc for gpu models, and likely a host compiler for cpu models. This is pretty problematic for integration into many native build tools, as the export process takes over building of the inference library. Cross compilation is impossible, as is passing flags to the build tools. 

An interface that would potentially be much friendlier would yield source code that could be fed into an existing build system rather than directly providing a library. This way pytorch wouldn't have to manage build tools in any capacity. There is likely a lot of complexity here, because code generation likely wants to hardcode many platform specific details, e.g. gpu type, cpu instruction sets. Being able to specify the platform constraints and capabilities on the aoti_compile interface would likely be wise, rather than attempting to automatically infer it from the local machine. 


### Alternatives

_No response_

### Additional context

_No response_

cc @ezyang @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @aakhundov @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4 @anijain2305 @peterbell10 @msaroufim @wconstab @bdhirsh @zou3519
Repository: pytorch
Issue: Adam Eager Benchmark Failures
Labels: triaged,module: inductor

### 🐛 Describe the bug

When running with Adam eager, about 1/3 of our benchmark models fail accuracy. It's about uniform across suites.

[list of failing models](https://github.com/pytorch/pytorch/pull/115445/files#diff-8f603ec8347c8ae8e05b9ba7f15dcc46b4aab1ba0e7efcf20881cc36f7e8edf8:~:text=the%20full%20benchmarks-,BENCHMARK_USE_SGD,-%3D%20%7B)

To run the benchmarks, run the [makefile](https://github.com/pytorch/pytorch/blob/main/benchmarks/dynamo/Makefile)

and then run the following command:

python <model suite>.py --training --accuracy --only=<model_name> --backend=inductor

and it should reproduce.

### Versions

Repros on main consistently

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
Repository: electron
Issue: [Feature Request]: Document deep link protocol length limits
Labels: enhancement :sparkles:

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Problem Description

I'm trying to enable our electron app for Windows (working in MacOS), and after a day and half of troubleshooting, I discovered that there are character limits for deep links under Windows.

The limit isn't with a browser, but Windows OS `ShellExecute` having a limit of 2083 chars (in my personal testing, it was 2048).

Related Chromium ticket:

https://bugs.chromium.org/p/chromium/issues/detail?id=727909

```
In Chrome, if you attempt to an Application Protocol URL over 2046 characters, you’ll see the regular Security Prompt, but clicking its “Launch Application” button does nothing.
```

tl;dr: Custom protocols in Windows have a limit of 2048 - 2083 characters. If you have such a URL coming from a browser, you'll get the prompt to open the app associated with the protocol, but on confirmation, nothing will get launched.

If you trim the URL length to less than 2048, your electron app will launch.

(You may be asking what are you putting in your custom protocol - for us it was a signed JWT, which can easily exceed that limit. We'll have to implement a device auth grant instead for our electron app.) 

Keywords: deep linking / deep link / windows / `setAsDefaultProtocolClient`

### Proposed Solution

Add documentation to deep links on the character limits for a URL when using a custom protocol by OS.

### Alternatives Considered

N/A.

### Additional Information

_No response_
Repository: godot
Issue: Shapecast reporting incorrect normals at the corners of tiles
Labels: discussion,topic:physics,needs testing,topic:2d

### Tested versions

Reproducible in 4.1.1 and 4.2.1

### System information

Godot v4.2.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 31.0.15.4584) - AMD Ryzen 5 5600X 6-Core Processor (12 Threads)

### Issue description

Using the physics layer of a tileset I created a Tile with a 45 degree slope and had the player move down and up the slope. The shapecast is pointed directly down and reports the normal of the slope. When moving on the slope the shapecast will sometimes report a vector with cardinal direction normals e.g. (0,-1) (1,0) (0, 1) seemingly randomly.
The image shows the output printing the players report floor normal, the shapecast normal, and a raycast normal that is casting from the center of the player. The raycast never reports (0,-1).
![image](https://github.com/godotengine/godot/assets/83610995/67edfb66-33a0-4300-83e4-87945d3eb0e5)



### Steps to reproduce

To reproduce this issue I created a brand new project and imported a tileset, and added some physics layer collision to tiles to create a 45 degree slope. Then I had the player move down the slope and changed the engine time_scale so that it would move less between each normal report. I moved the player to the right and applied gravity and it would report (0,-1) sometimes, most likely due to delta resulting in less precise movement. I also tested a small debug check that would move the player from one point on the slope down the slope at 0.1 increments and then report the shapecast and position when the shapecast is (0,-1) each of these positions coincided with the corners of tiles.

### Minimal reproduction project (MRP)

[Test.zip](https://github.com/godotengine/godot/files/13690992/Test.zip)
Repository: godot
Issue: Crash on startup
Labels: bug,topic:editor,needs testing,crash,regression

### Tested versions

4.2.1 stable

### System information

Windows 11 Lenovo laptop

### Issue description

Godot crashes on startup.  The project list screen isn't even shown.  Not sure where to look for a log file.  Godot 4.1.1 starts and runs fine on this machine.

### Steps to reproduce

Double click on the Godot_v4.2.1-stable_win64.exe file.  Command line fails too.

### Minimal reproduction project (MRP)

N/A
Repository: TypeScript
Issue: "Convert to ES module" crashes on recursive object member
Labels: Bug,Help Wanted

In a JavaScript file:

```js
/*$*/module.exports = {
    factorial(n) {
        if (n <= 1) {
            return 1;
        }
        return n * module.exports.factorial(n - 1)
    }
}
```

Request quick fixes at `/*$*/`.

```
Error: Debug Failure. False expression: Changes overlap
Verbose Debug Information: {"pos":29,"end":105} and {"pos":75,"end":93}
    at typescript/lib/tsserver.js:170302:15
    at mapDefined (typescript/lib/tsserver.js:2675:22)
    at Object.getTextChangesFromChanges (typescript/lib/tsserver.js:170298:12)
    at _ChangeTracker.getChanges (typescript/lib/tsserver.js:170195:35)
    at _ChangeTracker.with (typescript/lib/tsserver.js:169674:20)
    at Object.getCodeActions (typescript/lib/tsserver.js:149837:62)
    at typescript/lib/tsserver.js:148014:46
    at flatMap (typescript/lib/tsserver.js:2604:17)
    at Object.getFixes (typescript/lib/tsserver.js:148014:10)
    at typescript/lib/tsserver.js:146299:33
    at flatMap (typescript/lib/tsserver.js:2604:17)
    at Object.getCodeFixesAtPosition (typescript/lib/tsserver.js:146297:12)
    at IpcIOSession.getCodeFixes (typescript/lib/tsserver.js:186272:50)
    at getCodeFixes (typescript/lib/tsserver.js:184378:43)
    at typescript/lib/tsserver.js:186576:69
    at IpcIOSession.executeWithRequestId (typescript/lib/tsserver.js:186568:14)
    at IpcIOSession.executeCommand (typescript/lib/tsserver.js:186576:29)
    at IpcIOSession.onMessage (typescript/lib/tsserver.js:186618:51)
    at process.<anonymous> (typescript/lib/tsserver.js:188227:14)
    at process.emit (node:events:514:28)
    at emit (node:internal/child_process:937:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
```
Repository: neovim
Issue: API to get cursor position in terminal buffer
Labels: enhancement,api,terminal

### Problem

I want to get the cursor position (line number) in terminal mode.
This is the part of the highlighted `TermCursorNC` .

I checked following functions but could not find API that I want.

```
:h nvim_win_get_cursor 
:h getcurpos
:h getline
```

### Expected behavior

What I want to achieve by this API is related to #8816 .
I want to automatically enter insert mode only when the cursor position in the terminal buffer is visible.
When the cursor position in the terminal is not in the window, I do not want it to enter INSERT mode because it is scrolling up.

To explain in concrete code, I want to define the following autocmd, which will only enter insert mode when the cursor is present in the current terminal window.

```
vim.api.nvim_create_autocmd("BufEnter", {
  pattern = "term://*",
  callback = function()
    -- top line in window
    local start_line = vim.fn.line("w0")
    -- bottom line in window
    local end_line = vim.fn.line("w$")
    
    -- could not get currently?
    local cursor_line = XXX

    if start_line <= cursor_line and cursor_line <= end_line then
      vim.cmd.startinsert()
    end
  end,
})
```

For this I needed API of the title.

It would be good to have this API as it may be used for other purposes.
Repository: pytorch
Issue: Implement KV cached attention with NestedTensor
Labels: triaged,module: nestedtensor

### 🚀 The feature, motivation and pitch

NestedTensor would save tons of resource in SDPA, but it seems to be missing some feature to implement kv cached attention with NestedTensor. Or at least missing a best practice?

How do I store the cached kv? And how do I concat the cached and new kv together?


Heres are some of failed my attempts:
1. concat new tensor to exist NT
```python
batch_size=8
memory_seq_len=9
new_seq_len=2
n_head=4
head_dim=16

# model inputs
cache_keys_normal = torch.rand(batch_size,memory_seq_len,n_head,head_dim) # same seq_len for simple demo here
new_keys_normal = torch.rand(batch_size,new_seq_len,n_head,head_dim)
# -----------

cache_keys = torch.nested.as_nested_tensor(list(cache_keys_normal.unbind(0)))
new_keys = torch.nested.as_nested_tensor(list(new_keys_normal.unbind(0)))

concated_keys = torch.cat([cache_keys,new_keys], dim=1)
# RuntimeError: setStorage: sizes [88, 4, 16], strides [64, 16, 1], storage offset 5632, and itemsize 4 requiring a storage size of 45056 are out of bounds for storage of size 22528
# It seems we can only concat dim=0 and dim=-1 of NT currently, not dim=1
```

2. build NT after normal concat, using narrow()
```python
concated_keys_normal = torch.cat([cache_keys_normal,new_keys_normal], dim=1)
concated_keys_nested = torch.nested.narrow(concated_keys_normal, 1, 1, 11, layout=torch.jagged)

concated_keys_nested = concated_keys_nested.transpose(1, 2)
# ValueError: transpose(): not supported on jagged layout nested tensor with holes
```

3. same as attempt 2, but tranpose before build NT
```python
concated_keys_nested = torch.nested.narrow(concated_keys_normal.transpose(1,2), 2, 1, 11, layout=torch.jagged)
# RuntimeError: jagged layout only supports dim=1
```

4. squeeze n_head in to batch dim, bypass the dim=1 limit
```python
concated_keys_normal_squeezed = concated_keys_normal.transpose(1,2).reshape(-1, *concated_keys_normal.shape[2:])
concated_keys_nested = torch.nested.narrow(concated_keys_normal_squeezed, 1, 1, 11, layout=torch.jagged)

F.scaled_dot_product_attention(concated_keys_nested, concated_keys_nested, concated_keys_nested) # just use same tensor as qkv here for demo
#   File "/opt/miniforge311/lib/python3.11/site-packages/torch/nested/_internal/ops.py", line 736, in transpose_int
#    raise ValueError(
# ValueError: transpose(): not supported on jagged layout nested tensor with holes
```


### Alternatives

_No response_

### Additional context

_No response_

cc @cpuhrsch @jbschlosser @bhosmer @drisspg @soulitzer