sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: cmd/compile: optimize switch x := any(t).(type) for generics
Labels: NeedsInvestigation,compiler/runtime

I've got a trie structure that works over 4 byte arrays and 16 byte arrays, for IPv4 and IPv6 respectively. I used to just use a `[]byte` slice for this, and adjust accordingly based on `len(x)` when it mattered.

Actually, pretty much the only place it mattered was here:

```go
func commonBits(ip1, ip2 []byte) uint8 {
	if len(ip1) == 4 {
		a := binary.BigEndian.Uint32(ip1)
		b := binary.BigEndian.Uint32(ip2)
		x := a ^ b
		return uint8(bits.LeadingZeros32(x))
	} else if len(ip1) == 16 {
		a := binary.BigEndian.Uint64(ip1)
		b := binary.BigEndian.Uint64(ip2)
		x := a ^ b
		if x != 0 {
			return uint8(bits.LeadingZeros64(x))
		}
		a = binary.BigEndian.Uint64(ip1[8:])
		b = binary.BigEndian.Uint64(ip2[8:])
		x = a ^ b
		return 64 + uint8(bits.LeadingZeros64(x))
	} else {
		panic("Wrong size bit string")
	}
}
```

So in converting this all away from slices and toward static array sizes, I made this new type constraint:

```go
type ipArray interface {
	[4]byte | [16]byte
}
```

Then I broke out those two if clauses into their own functions:

```go
func commonBits4(ip1, ip2 [4]byte) uint8 {
	a := binary.BigEndian.Uint32(ip1[:])
	b := binary.BigEndian.Uint32(ip2[:])
	x := a ^ b
	return uint8(bits.LeadingZeros32(x))
}

func commonBits16(ip1, ip2 [16]byte) uint8 {
	a := binary.BigEndian.Uint64(ip1[:8])
	b := binary.BigEndian.Uint64(ip2[:8])
	x := a ^ b
	if x != 0 {
		return uint8(bits.LeadingZeros64(x))
	}
	a = binary.BigEndian.Uint64(ip1[8:])
	b = binary.BigEndian.Uint64(ip2[8:])
	x = a ^ b
	return 64 + uint8(bits.LeadingZeros64(x))
}
```

So far, so good, but what is the implementation of `commonBits`?

```go
func commonBits[B ipArray](ip1, ip2 B) uint8 {
	// ???
}
```

If you try to convert the array to a slice, the compiler will bark at you. You can use `any(ip1).(type)` in a switch, but then you get runtime overhead. I've figured out a truly horrific trick that combines two Go 1.17 features into an unholy mess:

```go
func giveMeA4[B ipArray](b B) [4]byte {
	return *(*[4]byte)(unsafe.Slice(&b[0], 4))
}

func giveMeA16[B ipArray](b B) [16]byte {
	return *(*[16]byte)(unsafe.Slice(&b[0], 16))
}

func commonBits[B ipArray](ip1, ip2 B) uint8 {
	if len(ip1) == 4 {
		return commonBits4(giveMeA4(ip1), giveMeA4(ip2))
	} else if len(ip1) == 16 {
		return commonBits16(giveMeA16(ip1), giveMeA16(ip2))
	}
	panic("Wrong size bit string")
}
```

This... works, amazingly. Similarly, when I needed to adjust my randomized unit tests, I wound up going with code that looks like this:

```go
var addr B
rand.Read(unsafe.Slice(&addr[0], len(addr)))
```

I asked some Go experts if there was a better way, and the answer I got was that generics aren't yet well suited for arrays. So, I'm opening this rather vague report in hopes that it can turn into a proposal for something useful.

CC @danderson @sebsebmc @josharian
Repository: deno
Issue: Don't spawn a thread when terminating a worker
Labels: bug,runtime

#12658, which is a still unfixed V8 bug, was worked around by first signaling to the worker that its event loop should stop whenever possible, and then starting a new thread that would wait for two seconds and then kill the worker's isolate, in case the worker was stuck in a JS endless loop. I felt it necessary to perform this waiting in a new thread rather than in a task on the current thread's event loop because the current event loop might finish well before the process finished, and it was not acceptable to leave the worker unkilled in that case.

I've since realized that, since child workers don't survive termination of their parent, it's fine to kill any not-yet-killed workers when their parent's event loop is finishing. In order to do this, there should be a set in the current `OpState` to store the isolate handles (and `has_terminated` flags?) for scheduled-but-not-yet-killed workers, with a `Drop` impl that kills all workers still in the set. Then, `WebWorkerHandle::terminate` should:
- kill the worker immediately if it's being called when the current thread's event loop is terminating
- otherwise, schedule termination, add the worker's isolate handle to the set, and spawn a tokio task that waits for two seconds and then kills the worker and removes it from the set.

#13941 is a precondition for this.
Repository: TypeScript
Issue: Contextually typed object method parameter doesn't have JSDoc attached
Labels: Suggestion,Experience Enhancement

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

- JSDoc object method parameter

### 🕗 Version & Regression Information

- This is the behavior in every version I tried

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.6.2#code/C4TwDgpgBA8mwEsD2A7AzlAvFA3gKCigHoAqEgwkqAQSgGMBDAGyYCMG6BrKYJegJwgNg0BlEEATBILrBxAVyYQAdBShUAAmAb8GAWyjbgACxoooEAB4I0iFAHNxSeSMPDjazYODz+6Giw8xtBGxhgAZvxIBgDuxgh0pjHQaMbOTBLiEFIycrxQAAahBZ5EFHSCwhAAStnSELJoAFxQABRqxGRmFta2CA5OLiHu6mWEhKEttvz99hQAlFgAfFDTswDaALpQAD6rwDMDeyiKTLtQ8igSEOH92QDceAC+eHh0qLZQSPDI6C1wiA+WFw5UqIlqOQawDQrVCi3w4yyPj8UBOLEehBeLyAA)

### 💻 Code

```ts
type Options = {
  /**
   * A callback to create a redirect rule.
   * @param path An existing route path
   * @returns All the paths from which we should redirect to `path`
   */
  createRedirects: (
    /** An existing route path */
    path: string,
  ) => string[] | string | null | undefined;
}

const options: Options = {
  createRedirects(path) {
    return null;
  }
}
```

### 🙁 Actual behavior

No JSDoc is shown when hovering over the `path` parameter:

<img width="672" alt="image" src="https://user-images.githubusercontent.com/55398995/158721937-ee9fbaab-862b-4194-9fe5-a2fc1bae4c1d.png">

### 🙂 Expected behavior

The JSDoc should be attached, either by recognizing the `@param`, or the comment directly attached to the parameter type.

The following all work:

**Intellisense when completing the method**

<img width="604" alt="image" src="https://user-images.githubusercontent.com/55398995/158722135-60e6e377-8021-40ec-bdb8-cf83f592ec2d.png">

**Intellisense when calling the method**

<img width="672" alt="image" src="https://user-images.githubusercontent.com/55398995/158722109-9f55c7a8-075e-4bc0-8083-052f2683a199.png">

**Destructuring object parameter**

```ts
type Options = {
  /**
   * A callback to create a redirect rule.
   * @returns All the paths from which we should redirect to `path`
   */
  createRedirects: (args: {
    /** An existing route path */
    path: string,
  }) => string[] | string | null | undefined;
}

const options: Options = {
  createRedirects({path}) {
    return null;
  }
}
```

<img width="604" alt="image" src="https://user-images.githubusercontent.com/55398995/158722229-d27029c5-10c4-49a8-bba2-8afa743e2a1d.png">
Repository: godot
Issue: InputMap.action_has_event should capture TouchScreenButton actions
Labels: enhancement,discussion,topic:input

### Godot version

3.4

### System information

Windows 10

### Issue description

I found it to be unexpected that `InputMap.action_has_event("action", event)` doesn't capture TouchScreenButton InputEventAction events.

I believe that it's because the project InputMap doesn't directly include the button as an action trigger, but given that the button is firing off the same event, shouldn't it be captured by this method?

Would it make sense for TouchScreenButtons with `action` set to be automatically added to the InputMap?

### Steps to reproduce

Create a valid TouchScreenButton with `"button"` as the action, create the action in the InputMap, and try this code:
```
func _input(event):
	if event is InputEventAction:
		print("InputEventAction {%s, %s} ✓" % [event.action, event.pressed])
	if InputMap.action_has_event("button", event):  # <-- not fired.
		print("InputMap.action_has_event ✓")
```

### Minimal reproduction project

Demo project showing the handling of a `InputEventAction` (compared to `action_has_event`): [touch-mrp.zip](https://github.com/godotengine/godot/files/8280974/touch-mrp.zip)
Repository: deno
Issue: Prompt changes and testing
Labels: feat,permissions,testing

With prompt by default, allowing a permission in one module's test doesn't carry over to another test.  For example if module `a.test.ts` requires net access, and it is granted, it will not carry over to tests in `b.test.ts` and you will get re-prompted again.
Repository: material-ui
Issue: [l10n] Unified Modern Standard Arabic localization
Labels: discussion,l10n,enhancement

### Summary 💡

You are supporting Arabic language based on countries... but the problem is Arabic language has a standard that all can understand.  therefore, instead of having to do multiple locales for each Arabic speaking country, just support the Modern Standard Arabic. I don't know if there is a code for it. I mean it is just 'ar'. and since you only willing to accept only up 100 locales I think localizing to Arabic by country is a waste. and eventually Arab do not write in dialect. all books and websites used the same language "Modern Standard Arabic". if this is possible, I can do a PR. 

### Examples 🌈

https://mui.com/material-ui/guides/localization/

<img width="424" alt="Screenshot 2023-10-19 at 17 41 32" src="https://github.com/mui/material-ui/assets/3165635/83dfa1e2-c8a9-427d-aa36-080fed61e2bc">

Instead of having 'ar-SD', 'ar-SA', 'ar-EG', it should only be 'ar'

### Motivation 🔦

It does not make any since to have so many locales for Arabic, and all use Standard Arabic for writing things.
Repository: terminal
Issue: Add a setting to force LTR / logical order for incoming text
Labels: Issue-Feature,Product-Terminal,Area-i18n,Area-AtlasEngine

# Description of the new feature/enhancement

Created out of: #12294
For reference: https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.force_ltr

The following applies practically only to Hebrew:
Some applications (`vim -H` for instance) write RTL scripts already in reverse in order to place glyphs on the right side of the terminal. In order for us to support such RTL-aware applications we need to add a setting which allows the user to suppress BiDi detection.

# Proposed technical implementation details (optional)

When we add BiDi detecting in AtlasEngine, we should skip the detection if rendering in "logical order" is force-enabled.
Repository: pytorch
Issue: Efficient very large (e.g., 31x31) depth-wise convolution
Labels: module: convolution,triaged,needs research

### 🚀 The feature, motivation and pitch

Very large depth-wise convolution can significantly boost the performance, especially on the downstream tasks. The next-generation models like ConvNeXt and RepLKNet heavily use kernel sizes >= 7x7. Compared to the default implementation of PyTorch, we have shown that large can be accelerated by our preliminary implicit-GEMM solution: 7x7 can be accelerated by 2x and 31x31 by 20x. Our implementation in MegEngine has been open-sourced. It would be great to see PyTorch support it too.

Implementations in MegEngine: https://github.com/MegEngine/cutlass/blob/master/examples/19_large_depthwise_conv2d_torch_extension/
https://github.com/MegEngine/MegEngine/tree/8a2e92bd6c5ac02807b27d174dce090ee391000b/dnn/src/cuda/conv_bias/chanwise

RepLKNet:
https://arxiv.org/pdf/2203.06717.pdf
ConvNeXt:
https://arxiv.org/abs/2201.03545


### Alternatives

_No response_

### Additional context

![image](https://user-images.githubusercontent.com/55726946/158738108-f9bce4ec-75d3-4fa5-86d3-4dcf1705359a.png)
![image](https://user-images.githubusercontent.com/55726946/158738150-df34b421-2f77-40ba-9e5a-6dd53441e0c1.png)
Repository: flutter
Issue: Implement PlatformDispatcher.onError for web
Labels: tool,engine,platform-web,a: error message,P2,team-web,triaged-web

https://github.com/flutter/engine/pull/32078 is implementing a new callback on PlatformDispatcher for handling uncaught errors. It's only stubbing things out for web, since the intiailization story is not really contained to the engine code on web at this point but also involves a template generated from the tool.

See https://flutter.dev/go/error-handling

/cc @jonahwilliams @ditman fyi
Repository: go
Issue: testing,internal/fuzz: Whether to support printing random corpus in the future
Labels: NeedsInvestigation

  ###Whether to support printing random corpus in the future, so that we can check which data has been tested .Since I found that the Print didn't work even if I added fmt.Print, I wanted an error-like interrupt to Print out what I wanted to Print.
Repository: go
Issue: math/big: infinite loop in Int.ModSqrt for p = 1
Labels: NeedsInvestigation

When passing p=1 in ModSqrt function, the code goes in infinite loop:
https://github.com/golang/go/blob/3463852b7631adbdd65646539fc87d967dcd13e6/src/math/big/int.go#L940

The Jacobi symbol will gives one for ever.

For example: https://go.dev/play/p/37ExZ6Y-Hdp
Repository: tauri
Issue: [feat] (macOS) (MAS) Security Scoped Resources via startAccessingSecurityScopedResource
Labels: type: feature request,platform: macOS

### Describe the problem

For _macOS_ it is **important** to have the functions [startAccessingSecurityScopedResource()](https://developer.apple.com/documentation/foundation/nsurl/1417051-startaccessingsecurityscopedreso) and [stopAccessingSecurityScopedResource()](https://developer.apple.com/documentation/foundation/nsurl/1413736-stopaccessingsecurityscopedresou). This is required for apps from the Apple MacStore.

Without it, you **can't save** folder or file selections in MacOS. This means that when a new file is accessed, a file dialog must be displayed again. 

### Describe the solution you'd like

The app API has following function

```ts
app.startAccessingSecurityScopedResource(bookmarkData)
```

**bookmarkData** _string_ - The base64 encoded security scoped bookmark data returned by the _dialog.open_ or _dialog.save_ methods

Returns Function - This function must be called once you have finished accessing the security scoped file. If you do not remember to stop accessing the bookmark, [kernel resources will be leaked](https://developer.apple.com/reference/foundation/nsurl/1417051-startaccessingsecurityscopedreso?language=objc) and your app will lose its ability to reach outside the sandbox completely, until your app is restarted.

```ts
// Start accessing the file.
const stopAccessingSecurityScopedResource = app.startAccessingSecurityScopedResource(data)
// You can now access the file outside of the sandbox 🎉

// Remember to stop accessing the file once you've finished with it.
stopAccessingSecurityScopedResource()
```


### Alternatives considered

_No response_

### Additional context

_No response_
Repository: godot
Issue: Exported Blender materials appear faded on iOS (GLES3)
Labels: bug,platform:ios,topic:rendering,topic:import,topic:3d

### Godot version

v3.5.beta.custom_build [927dd95b2], v3.4.stable

### System information

iOS 15.3.1

### Issue description

Textured materials exported from Blender (packed in a `.glb` file) appear faded when exporting to iOS where in Blender the material is just a simple UV-mapped material with the base color set to `Image Texture`. Non-textured materials (base color set to any color instead of an image texture) are working fine. 
On macOS all colors appear normal while on iOS, even with disabled `Force Vertex Shading.mobile`, the textured material appears faded and overexposed.

![comparing](https://user-images.githubusercontent.com/44228394/158764942-248f1a4e-b1fd-4199-aaa2-0502a133a524.jpg)



### Steps to reproduce

Run the provided minimal reproduction project on macOS and the exported one on a real iOS device. Compare the colors:
1. Left: Exported `.glb` from Blender with textured material (overexposed, faded)
2. Center: MeshInstances created in Godot
3. Right: Exported `.glb` from Blender with basic color material (looks okay)

### Minimal reproduction project

[https://github.com/godotengine/godot/files/8282551/ios_bug.zip](https://github.com/godotengine/godot/files/8282551/ios_bug.zip)
[https://we.tl/t-TbvwSYRFpJ (WeTransfer link)](https://we.tl/t-TbvwSYRFpJ)
Repository: PowerToys
Issue: Keyboard manager - show resulting symbol for mapped shortcut
Labels: Idea-Enhancement,Product-Keyboard Shortcut Manager,Needs-Triage

### Description of the new feature / enhancement

in SLK layout im adding keys to have programmers symbols like $ & # and brackets on positions same as in english layout. For organization it would be nice to have ability to naming the stroke combination, enought in small letter above the row in manager. Or show what it means in currently set layout.

### Scenario when this would be used?

see above, when i find out i missed adding some key, i tend to look what i have already defined, but seeing AltGr+ô is not as clear, as knowing it generates $ on SVK layout, so i mapped it to AltGr+4 to match EN layout for upper number keys

### Supporting information

_No response_
Repository: godot
Issue: 'open scripts' list shows blank entry when name of script is changed
Labels: bug,topic:editor,confirmed,usability

### Godot version

3.3.stable

### System information

windows 10

### Issue description

In the list of opened scripts, a renamed script shows up 2x : once with correct (new) name, and once without a name.
In the image, I renamed a script from 'Game.gd' to 'game.gd'

![open_scripts_list](https://user-images.githubusercontent.com/59080934/158781118-c3dcbd93-1efd-4a9f-af37-a053feddf5a4.png)


### Steps to reproduce

rename a script that is in the list of opened scripts

### Minimal reproduction project

_No response_
Repository: flutter
Issue: [Proposal]Generated windows files should be git ignored by default
Labels: tool,platform-windows,c: proposal,a: build,P3,team-tool,triaged-tool

## Steps to Reproduce

- Just run a flutter project for web or android it will still generate files needed for windows build

**Expected results:**
- Supposedly the build files only for specific files should be generated.

**Actual results:**
- Windows related build files are also generated even when we just ran the app on web or android platform.

------------

Not much details required, I just would like flutter team to please add the build files related to windows into .gitignore automatically just like it is done for other ones else it is a bit of a frustrating thing for one to discard them. Yeah one can put them manually into .gitignore and that is what I am doing currently but what if one doesn't knows that even ? 😅 

------------

No code sample required running any flutter app will reproduce this issue.

------------

The names of additional 2 files are mentioned below :

1. generated_plugin_registrant.h
2. generated_plugins.cmake

I don't think so that any code will be needed specifically to reproduce this issue or if any logs would help in debugging the same if needed please do let me know in the comments and I will edit and add the required code/log output below.
Repository: vscode
Issue: Add a way to read all enabled extensions across all extension hosts
Labels: feature-request,api,extension-host,api-proposal,api-finalization

`vscode.extensions.all` or `vscode.extensions.getExtension` will only return extensions from the current extension host. The root cause for this is that the return type `IExtension<T>` exposes the `.exports` property, which represents the extension's exported API. Since extensions can export synchronous APIs, we can't automatically proxy it to make it available to other extension hosts. 

Also, making `vscode.extensions.getExtension` return an extension running on a different extension host, has the potential to cause breakage in existing extensions.

We could add a new function to be able to get to extensions that are running on other extension hosts.

This came up before e.g. in #82633

cc @jrieken
Repository: angular
Issue: Irrecoverable serviceworker state when the prefetch assets encounter a network error
Labels: area: service-worker,P3

### Which @angular/* package(s) are the source of the bug?

service-worker

### Is this a regression?

No

### Description

When a user goes offline while the app is still downloading, the asset/media cache enters an "invalid" and irrecoverable state. Refreshing the window does not trigger an automatic retry for these assets, and the app cannot go offline (even though the SW is registered and the chunks are available).

### Please provide a link to a minimal reproduction of the bug

https://github.com/gabrielstellini/ngsw-issue-minimal-reproduction

### Please provide the exception or error you saw

The app could not throw an error because the app isn't loading offline. Online, the app seems to work fine, but it never gains offline capabilities after a failed download.


### Please provide the environment you discovered this bug in (run `ng version`)

```true
Angular CLI: 13.1.4
Node: 14.18.1
Package Manager: npm 6.14.15
OS: linux x64

Angular: 13.1.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1301.4
@angular-devkit/build-angular   13.1.4
@angular-devkit/core            13.1.4
@angular-devkit/schematics      13.1.4
@angular/cli                    13.1.4
@schematics/angular             13.1.4
rxjs                            7.4.0
typescript                      4.5.5
```


### Anything else?

 - A demo of this issue can be found below:

https://user-images.githubusercontent.com/16836689/158809721-3d1d1fd4-d367-418f-aab3-ee2fc7a748b8.mp4

 - The docs have a "Handling an unrecoverable state" section, but they only specify how to listen onto unrecoverable states, and not how to actually recover from them. So far I have tried:
 
 ```
  constructor(private swUpdate: SwUpdate) {
    swUpdate.unrecoverable.pipe(
      switchMap(() => {
        console.log('irrecoverable!');
        this.recover();
        return swUpdate.available;
      })
    ).subscribe(event => {
        swUpdate.activateUpdate().then(() => document.location.reload());
    });
  }

  public recover(): void {
    interval(1000).subscribe(() => {
      void this.swUpdate.checkForUpdate();
    });
  }
```

however the unrecoverable observable is not emmitting an event when the error happens.
Repository: react
Issue: Bug: <StrictMode> unexpected behavior for double invoked functions 
Labels: Type: Discussion,React 18

Detailed explanation of the case and reproducible example is in the sandbox itself:
https://codesandbox.io/s/smoosh-wind-9lrpp3?file=/src/App.js

I can only guess that there is a reason behind this decision but I can't understand it, or maybe I'm right and this could be changed.
At the moment this behavior looks more like a bug than intentional implementation.
Repository: flutter
Issue: Refactor `ShellTest.DiscardLayerTreeOnResize` and `ShellTest.DiscardResubmittedLayerTreeOnResize` when re-enabling them
Labels: engine,P3,c: tech-debt,team-engine,triaged-engine

When https://github.com/flutter/engine/pull/32058 landed, `BeginFrame` and `EndFrame` of `ExternalViewEmbedder` should be paired.  But we will have to fix the following tests for this change when re-enabling them.
* `ShellTest.DiscardLayerTreeOnResize`
*  `ShellTest.DiscardResubmittedLayerTreeOnResize`

Here is a potential solution:

Introduce a new mechanism, such as adding a closure called `draw_layer_tree_finished_callback` in `Settings`.
At the end of each `Rasterizer::Draw` and `Rasterizer::DrawLastLayerTree`, no matter whether it is succeeded or failed, this closure is called back, and this mechanism is used to replace the `ExternalViewEmbedder::EndFrame` in these tests.