sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: [dynamo] so-called global state guard is installed on global, when in fact values are thread-local
Labels: triaged,oncall: pt2,module: dynamo

### 🐛 Describe the bug

https://github.com/pytorch/pytorch/blob/971f67c9880b4037064b4bd24b858c80e6c69174/torch/_dynamo/convert_frame.py#L113

https://github.com/pytorch/pytorch/blob/971f67c9880b4037064b4bd24b858c80e6c69174/torch/_dynamo/convert_frame.py#L377

This means that we are not thread-safe with respect to compiling multiple functions at once across different threads.

### Specific Scenarios

For instance, one call to compile may set a new global state based on its thread-local values, and then another thread reads off those values when it is instantiating or checking a guard.

### Details

See that many of the values it captures:
https://github.com/pytorch/pytorch/blob/971f67c9880b4037064b4bd24b858c80e6c69174/torch/csrc/dynamo/guards.cpp#L438

Are in fact thread-local values:

https://github.com/pytorch/pytorch/blob/fa995626a8e181e3666b27fdb4edbe6116b22ee3/c10/core/AutogradState.h#L13

### Versions

main

cc @ezyang @msaroufim @bdhirsh @anijain2305 @zou3519 @chauhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @wconstab
Repository: rust
Issue: `#[track_caller]` does not work on `fn drop`
Labels: C-enhancement,T-compiler,F-track_caller,A-panic

Putting `#[track_caller]` on a `fn drop` implementation does not attribute the panic to the code that drops the value. Instead, some location in the standard library is blamed:

```rust
struct S;

impl Drop for S {
    #[track_caller]
    fn drop(&mut self) {
        panic!("panicking!");
    }
}

fn main() {
    let _variable = S;
}
```

Outputs:

```
thread 'main' panicked at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/ptr/mod.rs:497:1:
panicking!
```
Repository: rust
Issue: Unused `extern fn` in dead code warns
Labels: A-lints,A-diagnostics,T-compiler,L-dead_code

### Code

```Rust
fn fun() {
    extern "C" {
        fn foo();
    }
    
    fn bar() {}
    
    unsafe { foo(); }
    bar();
}
```


### Current output

```Shell
warning: function `fun` is never used
 --> src/lib.rs:1:4
  |
1 | fn fun() {
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function `foo` is never used
 --> src/lib.rs:3:12
  |
3 |         fn foo();
  |            ^^^
```


### Desired output

```Shell
warning: function `fun` is never used
 --> src/lib.rs:1:4
  |
1 | fn fun() {
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default
```


### Rationale and extra context

`foo`'s calling code already generates a dead code warning, so `foo` itself should not generate another one, like `bar`.

### Other cases

_No response_

### Anything else?

_No response_
Repository: material-ui
Issue: [Menu][material-next] Add Material You component
Labels: on hold,component: menu,design: material you

### Duplicates

- [X] I have searched the existing issues

### Latest version

- [X] I have tested the latest version

### Summary 💡

This issue is to track the work for adding the Menu component to @mui/material-next, moving forward with the Material You effort (https://github.com/mui/material-ui/issues/29345)

Material You Chip specification: https://m3.material.io/components/menus/overview

**Migration Guide steps**

- [x] Copy component files from material (v5) to material-next: [PR](https://github.com/mui/material-ui/pull/39301)
- [x] Remove deprecated components and componentsProps props (not applicable, the component already uses the `slots` & `slotProps` props
- [x] Migrate component to Typescript [PR](https://github.com/mui/material-ui/pull/38934)
- [x] Refactor component to use Base UI’s hook if it exists [PR](https://github.com/mui/material-ui/pull/38934)
- [ ] autoFocus should be configurable [PR](https://github.com/mui/material-ui/pull/39960)
- [x]  ~there shouldn't be a need in the test to focus the menu so that the keyboard keys can be tested~ - this is due to the fact that auto opened menus shouldn't steal focus. We need to document this in the migration guide
- [ ] select menu variant support (in Base UI the menu items have no notion of selection, this will need to be changed)
- [ ] Ensure slots & slotProps have keys for each slot
- [ ] Drop support for ThemeProvider in favor of CssVarsProvider
- [ ] Implement Material You design specs
- [ ] Add component playground to v5 docs
- [ ] Refactor styles to use component CSS Variables

**Note**: If a task is marked as [WIP] it means someone is working on it
Repository: material-ui
Issue: [material-ui][Menu] Incorrect padding-right value on body when Menu opens inside iframe
Labels: component: menu,package: material-ui

### Duplicates

- [X] I have searched the existing issues

### Latest version

- [X] I have tested the latest version

### Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/sharp-yonath-7mj7sk

Steps:

1. Make sure that the scrollbar is showing inside the iframe with gray border. If you're using Mac, you may need to go to System Settings > Appearance > Show scroll bars and select "Always" option.

2. Go to the link and click on "DASHBOARD" button inside the iframe to open menu.


### Current behavior 😯

Once the menu is open, you can see that `padding-right` style is set on the iframe body element, which is much larger than the width of the iframe scrollbar.

<img width="535" alt="Screenshot 2023-10-18 at 1 26 09 AM" src="https://github.com/mui/material-ui/assets/13882991/3b40d003-fb20-4006-9497-6206cf6d95e4">
<img width="338" alt="Screenshot 2023-10-18 at 1 29 16 AM" src="https://github.com/mui/material-ui/assets/13882991/c8a0bd61-9be0-4fae-9859-18f8a468a6d5">

### Expected behavior 🤔

Opening menu should set correct `padding-right` value for the scrollbar width for the iframe. It currently uses difference between parent window innerWidth and iframe content document cilentWidth to calculate this value, which results in a very large value.

The issue is also reported in #39328

### Context 🔦

_No response_

### Your environment 🌎

<details>
  <summary><code>npx @mui/envinfo</code></summary>

```
  System:
    OS: macOS 14.0
  Binaries:
    Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn
    npm: 9.6.6 - ~/.nvm/versions/node/v18.16.0/bin/npm
  Browsers:
    Chrome: 118.0.5993.88
    Edge: 114.0.1823.51
    Safari: 17.0
  npmPackages:
    @emotion/react: ^11.10.6 => 11.11.1
    @emotion/styled: ^11.10.6 => 11.11.0
    @mui/base: ^5.0.0-beta.3 => 5.0.0-beta.20
    @mui/core-downloads-tracker:  5.14.14
    @mui/icons-material: ^5.11.16 => 5.14.14
    @mui/lab: ^5.0.0-alpha.134 => 5.0.0-alpha.149
    @mui/material: ^5.12.3 => 5.14.14
    @mui/private-theming:  5.14.14
    @mui/styled-engine:  5.14.14
    @mui/system:  5.14.14
    @mui/types:  7.2.6
    @mui/utils:  5.14.14
    @mui/x-data-grid: ^6.3.0 => 6.16.2
    @mui/x-date-pickers: ^6.3.0 => 6.16.2
    @mui/x-tree-view:  6.0.0-alpha.1
    @types/react: ^18.0.28 => 18.2.28
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0
    typescript: ^5.0.4 => 5.2.2
```
</details>
Repository: tauri
Issue: [feat] Dynamically Adjusting CSP in Tauri for Enhanced Extension Security
Labels: type: feature request

### Describe the problem

Brackets and VS-Code both offer the feature of installing third-party extensions. However, these extensions often hail from untrusted sources, potentially granting them extensive local user permissions. Currently brackets extensions have unrestricted local access. It's worth noting that the security model of VS-Code's extensions isn't any better than trust me bro too: https://blog.aquasec.com/can-you-trust-your-vscode-extensions

To enhance security, we're aiming for an approach that doesn't require us to blindly trust these extensions. Web browsers, like the ones Tauri is built on, have largely addressed similar concerns for web pages using CSP headers. Our idea is that when an extension is installed, it should clearly define the URLs it will communicate with in its manifest. By doing so, we can whitelist these URLs through CSP, ensuring extensions communicate only with expected endpoints. This not only enhances trust but also provides an audit trail. Moreover, introducing a "lockdown mode" for extensions becomes feasible; by simply removing all extension-specified URLs from the CSP header, we can further bolster our app's security.

Upon building a Tauri application, the CSP appears to be hard-coded into the binary. While we've added necessary exceptions for Tauri asset URLs, we're faced with the challenge of dynamically updating the CSP based on extensions' requirements (effective upon the next app load).

The goal is to have granular control over the URLs extensions can access post their installation. However, our current method of setting the CSP via meta tags in the main index.html page feels restrictive, especially when considering the need to use wildcards (*) in certain instances. This leads us back to the less secure model where extensions aren't strictly controlled.

### Describe the solution you'd like

Question:
Given this context, is there a feasible method to dynamically update or modify the CSP within a Tauri application to address these security considerations?

Ideally, for us, these are the APIs needed in js:
` __tauri__.api.setCSPMetaTag("new csp header")`  will set the csp header upon app restart. OR something similar conceptually. We do not use the tauri CSP config `/tauri/security/csp` as it is corrupting Brackets dynamically loaded HTML content as most of the app is created by JS.

### Alternatives considered

_No response_

### Additional context

https://discord.com/channels/616186924390023171/1164542520689168486
Repository: pytorch
Issue: Tensor `.cuda()` very slow with specific array sizes 
Labels: module: performance,module: cuda,triaged

### 🐛 Describe the bug

I've been profiling some streaming code and found a strange case where copying a tensor to the GPU is much slower for specific array sizes.

This is specific to arrays that are fortran-ordered to begin with and the issue is mitigated by calling `.clone()` on the tensor before `.cuda()`.

```
rows = 327680   # 2 ** 16 * 5
np_arr = np.asfortranarray(np.random.randn(rows, 2000).astype(np.float32))
arr = torch.from_numpy(np_arr)
x = arr[10_000: 50_000]   # grab a subset of 40k rows

%%time
_ = x.cuda()
```

This takes around 800ms on my machine.

With `rows = 327680 - 1`, it takes 280ms on my machine.
With `rows = 327680 + 1`, it takes 170ms on my machine.
With `rows = 100000`, it takes 80ms on my machine.

In all cases, adding a `.clone()` prior to `.cuda()` seems to reduce the time to around 80ms. In general it seems that multiples of 2^16 perhaps perform slower (I've tried with 2^16 and 2^16 - 1 and there seems to be a significant difference).

### Versions

Collecting environment information...
PyTorch version: 2.1.0+cu118
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.3 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.35

Python version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.86-flatcar-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 11.7.99
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA A100-SXM4-80GB
Nvidia driver version: 470.103.01
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Address sizes:                   48 bits physical, 48 bits virtual
Byte Order:                      Little Endian
CPU(s):                          128
On-line CPU(s) list:             0-127
Vendor ID:                       AuthenticAMD
Model name:                      AMD EPYC 7542 32-Core Processor
CPU family:                      23
Model:                           49
Thread(s) per core:              2
Core(s) per socket:              32
Socket(s):                       2
Stepping:                        0

Versions of relevant libraries:
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.26.1
[pip3] pytorch-lightning==2.1.0
[pip3] torch==2.1.0+cu118
[pip3] torchmetrics==1.2.0
[pip3] triton==2.1.0
[conda] Could not collect

cc @ptrblck
Repository: godot
Issue: RemoteTransform3D descendant _notification cannot be overridden
Labels: discussion,topic:core,documentation

### Godot version

4.2.beta

### System information

Windows 11

### Issue description

I'm trying to write a descendant to `RemoteTransform3D`, where the position updates are smoothed with a critical spring damper.

It's impossible to do this because RemoteTransform3D does its work in `_notification`, and that function seems to have a problem being overridden (BOTH inheritor and ancestor code is run, without an explicit call using `super`)

**Expectation:**
Ancestor code should only be executed in a `super._notification(...)` call.

### Steps to reproduce



https://github.com/godotengine/godot/assets/8904620/750e3618-40c1-4ae1-a291-8a79aa89b447



1. load project
2. press play
3. see text move 

**Expectation**: shouldn't move, because `_notification` on `DerivedRemoteTransform3D.gd` contains only a log statement, and no super call.



### Minimal reproduction project

[notification-override-bug-repro.zip](https://github.com/godotengine/godot/files/13044771/notification-override-bug-repro.zip)
Repository: material-ui
Issue: [docs] Translate the documentation to Chinese / 将文档翻译成中文
Labels: docs,waiting for 👍,l10n,i18n,scope: docs-infra

### Summary 💡

There is a huge community of Chinese developers https://en.wikipedia.org/wiki/List_of_languages_by_total_number_of_speakers

<img width="975" alt="Screenshot 2023-10-19 at 17 03 15" src="https://github.com/mui/material-ui/assets/3165635/12e81f9f-8be8-4ed8-adf0-3e01154eb0f3">

But very few actually speak English: https://www.quora.com/What-of-Chinese-speak-English, likely fewer than 10%.

Translating the docs could be a great growth opportunity, especially for MUI X, Base UI, and MUI System which are a lot less design-dependent.

### Examples 🌈

- https://recharts.org/zh-CN/
- https://www.qt.io/zh-cn/

### Context 

- https://mui-org.notion.site/Docs-localization-what-s-next-3f370280b58f446fbb5559dfc08fe03e
- Struggle to communicate with Chinese users https://www.notion.so/mui-org/Lee-jijyun-f4786a2f39344d428564b8722d74a3fa?pvs=4#6ed6fb0ac5f74be7904dfb1e33dac17a

---

### 总结💡

有一个庞大的中国开发者社区 https://zh.wikipedia.org/wiki/%E6%8C%89%E4%BA%BA%E5%8F%A3%E6%8E%92%E5%88%97%E7%9A%84%E8%AF%AD%E8%A8%80%E5%88%97%E8%A1%A8

<img width="980" alt="Screenshot 2023-10-19 at 17 10 22" src="https://github.com/mui/material-ui/assets/3165635/cfdd5167-59a5-442b-90d2-5a95a0c884f6">

但实际上很少有人会说英语：https://www.quora.com/What-of-Chinese-speak-English，可能不到 10%。

翻译文档可能是一个巨大的增长机会，特别是对于 MUI X、Base UI 和 MUI System 来说，它们对设计的依赖性要小得多。

### 例子🌈

- https://recharts.org/zh-CN/
Repository: vscode
Issue: DebugAdapterTracker not working in web extensions
Labels: bug,debug

<!-- ⚠️⚠️ 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/No

Yes (except my extension)

<!-- 🪓 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.81.1
- OS Version: OSx 13.4.1 

Steps to Reproduce:

Generate extensions using yo code, with the following code added to the activate functions. Create createDebugAdapterTracker isn't getting called in web extensions, but is getting called in a normal extension. I don't see this documented as a limitation on web extensions anywhere and I'm wondering if it is a known issue.

```
	console.log('registerDebugAdapterTrackerFactory')
	vscode.debug.registerDebugAdapterTrackerFactory('*', {
		createDebugAdapterTracker: (session: vscode.DebugSession): vscode.ProviderResult<vscode.DebugAdapterTracker> => {
			console.log("createDebugAdapterTracker", session.id);
			return {
				onWillStartSession(): void {
					console.log(session.id, 'onWillStartSession');
				},
				onWillReceiveMessage(message: any): void {
					console.log(session.id, 'onWillReceiveMessage', message);
				},
				onDidSendMessage(message: any): void {
					console.log(session.id, 'onDidSendMessage', message);
				},
				onWillStopSession(): void {
					console.log(session.id, 'onWillStopSession');
				},
				onError(error: Error): void {
					console.log(session.id, 'onError', error);
				},
				onExit(code: number | undefined, signal: string | undefined): void {
					console.log(session.id, 'onExit', code, signal);
				}
			};
		}
	});
```
Repository: material-ui
Issue: [l10n] Create a whitelist of support locales 
Labels: docs,l10n,MUI X,enhancement

### What's the problem? 🤔

We are currently adding new locales as developers are proposing them, however, we are not very clear on which locale we support. In https://mui.com/material-ui/guides/localization/#supported-locales, we say: 

<img width="774" alt="Screenshot 2023-10-19 at 17 34 14" src="https://github.com/mui/material-ui/assets/3165635/e8411a76-4f1d-4349-b78a-ae6c04150298">

Developers are left wondering, will my locale be accepted? Which locale is missing?

### What are the requirements? ❓

I think it could be awesome to:

- review https://w3techs.com/technologies/overview/content_language, https://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers, top 100 of https://www.ethnologue.com/insights/ethnologue200/
- See which locales we are missing
- Add them under a new table in https://deploy-preview-39481--material-ui.netlify.app/material-ui/guides/localization/
- Make it clear that we would love to get help on them; and that won't accept other locales.

### Context

This strategy would apply for MUI X too, cc @joserodolfofreitas 

- https://mui.com/x/react-date-pickers/localization/#supported-locales
- https://mui.com/x/react-data-grid/localization/#supported-locales
Repository: go
Issue: proposal: database/sql: add a common method to unwrap value of sql.Null* types
Labels: Proposal

## Proposal

Add an interface to `database/sql` implemented by `sql.Null*` types to unwrap the NULL or the value:

```go
// NullUnwrap allows to unwrap sql.Null* types.
type NullUnwrap interface {
	UnwrapNull() (value any, valid bool)
}
```
(names to be debatted)

Extend `sql.Null*` types to implement it:

```go
func (n Null[T]) UnwrapNull() (value any, valid bool) {                                                                                                                                                     
	if !n.Valid {
		return nil, false
	}
	return n.V, true
}
```

## Why?

There is currently no builtin generic way to unwrap the value of types `sql.Null`* ([`sql.NullBool`](https://pkg.go.dev/database/sql#NullBool),[`sql.NullByte`](https://pkg.go.dev/database/sql#NullByte), [`sql.NullInt16`](https://pkg.go.dev/database/sql#NullInt16), [`sql.NullInt32`](https://pkg.go.dev/database/sql#NullInt32)[`sql.NullInt64`](https://pkg.go.dev/database/sql#NullInt64), [`sql.NullFloat64`](https://pkg.go.dev/database/sql#NullFloat64), [`sql.NullString`](https://pkg.go.dev/database/sql#NullString), [`sql.NullTime`](https://pkg.go.dev/database/sql#NullTime)).

But at least the list of types was known, so it was possible to use a type switch. 

With the addition of [`sql.Null[T]`](https://pkg.go.dev/database/sql@master#Null) (#60370) for Go 1.22 the type switch solution will not be enough.

The only ways to unwrap an `sql.Null[T]` are just hacks using either the `driver.Valuer` interface or `reflect`:

(full example: https://go.dev/play/p/DnStyHLekX1?v=gotip)

```go
func UnwrapNullable(val driver.Valuer) (value any, valid bool) {
	v := reflect.ValueOf(val)
	if v.Field(1).Bool() {
		return v.Field(0).Interface(), true
	}
	return nil, false
}

func UnwrapNullable2(val driver.Valuer) (value any, valid bool) {
	value, err := val.Value()
	if err != nil {
		panic(err)
	}
	if value != nil {
		return value, true
	}
	return nil, false
}
```
A common method available on `sql.Null*` types would allow to have an efficient unwrapping and be type safe as unwrapping could be done after an interface check.

That interface could also help to distinguish types that are able to represent a `NULL` value (types that never return `valid == false` should not implement it).
Repository: pytorch
Issue: Dynamic shapes doesn't work for torch.diff / resize__symint in some cases
Labels: triaged,oncall: pt2,module: dynamic shapes

```python
a = torch.tensor([0, 2])
b = torch.tensor([1])

def fn(a, b):
    a = a.clone()
    b = b.clone()
    torch.diff(a, n=0, out=b)
    return b

compiled_f = torch.compile(fn, fullgraph=True, backend="eager", dynamic=True)
out = compiled_f(a, b)

# Works
a = torch.tensor([0, 3, 4]) # size changed
b = torch.tensor([1]) # size is the same
out = compiled_f(a, b)

# Doesn't work
a = torch.tensor([0, 3, 4]) # size changed
b = torch.tensor([1, 2]) # size changed
out = compiled_f(a, b)
```

Versions: main after https://github.com/pytorch/pytorch/pull/111530

cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305 @zou3519
Repository: neovim
Issue: Vertical conceal
Labels: enhancement,api,marks,conceal

### Problem

Since #25073, LSP hover and signature help use treesitter for syntax highlighting of Markdown content, especially embedded code. This requires code span delimiters which are concealed, but this leaves empty lines, wasting precious terminal space.

### Expected behavior

1. Support a new ephemeral extmark attribute `conceal_line`, which instructs the highlighter to skip the marked line(s) completely, controlled by (a new) `conceallevel`.

2. Add this to the supported attributes for the treesitter highlighter.

3. Use `#set! conceal_line ""` for `code_span_delimiter` in the `markdown` highlight query.

### Open questions

* How should movement over concealed lines work? (The same as horizontal movement over concealed columns, ideally.)

### Possible followups

* In addition to `conceal_line ""`, allow specifying a single(!) character that is rendered in every displayed cell of the line. (Use case: replacing `---` thematic breaks by proper separating lines, obviating the need for https://github.com/neovim/neovim/blob/315c711700a87fe3fa546906ab39557ebba19baf/runtime/lua/vim/lsp/util.lua#L1269-L1300)