sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: proposal: syscall: add Umask option to SysProcAttr for Unix-like platforms
Labels: Proposal

A Go program on Linux, *BSD, AIX, Solaris or Darwin is currently able to control the working directory and root directory of new processes launched with `os.StartProcess` by setting the `(os.ProcAttr).Dir` and `(syscall.SysProcAttr).Chroot` fields, respectively. In contrast, there is no way to control the file-creation mode mask (umask) attribute of started processes without introducing a race condition or paying a performance penalty to start an extraneous process or thread. I propose extending the `syscall.SysProcAttr` structs on the aforementioned platforms to permit setting the child's umask.
```go
type SysProcAttr struct {
	// [existing fields omitted...]
	SetUmask bool
	Umask    int  // Child's umask if SetUmask.
}
```

--------

New processes inherit the umask value of the parent, so one might think they could control the umask by writing something like:
```go
// DO NOT DO THIS
runtime.LockOSThread() // Does nothing to prevent the race condition below.
defer runtime.UnlockOSThread()
old := syscall.Umask(newUmask) // RACE CONDITION: modifies the umask attribute for the whole process.
defer syscall.Umask(old) // Ditto.
return os.StartProcess(...) // New process gets newUmask, maybe.
```

Because all threads of a Go process share the same working directory, root directory and umask attributes, any files created by other goroutines between the two `syscall.Umask` calls would be affected by the temporary umask change, and multiple goroutines interleaving temporary umask changes could result in an incorrect umask being restored.

The race conditions can be avoided by changing the umask in an execution context which does not share file system attributes with the threads of the Go process which goroutines execute on. The most portable method to do so requires performing an extra fork+exec ([for example](https://github.com/moby/buildkit/blob/1725efc1f448cc23a426183187204fec9ad65182/source/git/gitsource_unix.go)) though as of Go 1.10 a slightly less expensive alternative can be used on Linux which "only" costs one extra thread and the need to worry about #27505.
```go
// Linux only:
go func() {
	runtime.LockOSThread()
	// This operation is irreversible so the thread cannot be reused for other goroutines.
	syscall.Unshare(syscall.CLONE_FS)
	syscall.Umask(newUmask) // Only affects the current goroutine, and any processes spawned from it.
	os.StartProcess(...)
	// Return without calling runtime.UnlockOSThread() so the thread terminates.
	// The runtime will have to spawn a new thread at some point to replace it.
}()
```

The extra process/thread would not be needed if the umask could be set between fork and exec, exactly like how the working directory and root directory are currently set when spawning child processes.
Repository: flutter
Issue: [web] Explore reducing the size of HarfBuzz
Labels: dependency: skia,a: typography,a: size,platform-web,perf: app size,e: web_canvaskit,P2,team-web,triaged-web

CanvasKit/Skia contains a copy of HarfBuzz that's used for text shaping. We should explore the idea of removing some harfbuzz features that we don't need.

The idea was inspired by the [`harfbuzzjs`](https://github.com/harfbuzz/harfbuzzjs) project that uses the [`HB_TINY`](https://github.com/harfbuzz/harfbuzzjs/blob/d841f74432cb6af8787e56cc2e7b44fe9439f118/build.sh#L13) flag to build a much smaller version of harfbuzz. `HB_TINY` is very aggressive at removing features, so we may want to re-include some features like they do [here](https://github.com/harfbuzz/harfbuzzjs/blob/main/config-override.h).

First step here would be to do a quick evaluation of the potential gains, and whether it's worth the effort or not.
Repository: pytorch
Issue: torch.nn.functional.one_hot only works for int64
Labels: module: nn,triaged

### 🐛 Describe the bug

Tried applying torch.nn.functional.one_hot to an int32 and int16 tensor, got "[RuntimeError: one_hot is only applicable to index tensor.](https://github.com/pytorch/pytorch/blob/8d1ff9fc5dc70bdc65a83748c01cddf187728452/aten/src/ATen/native/Onehot.cpp#L6)"

It seems that it only works with int64 tensors. Is this behaviour expected? If so, why?

Thanks!

### Versions

PyTorch version: 1.12.1+cu113
Is debug build: False
CUDA used to build PyTorch: 11.3
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.6 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
CMake version: version 3.22.6
Libc version: glibc-2.26

Python version: 3.7.14 (default, Sep  8 2022, 00:06:44)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.10.133+-x86_64-with-Ubuntu-18.04-bionic
Is CUDA available: True
CUDA runtime version: 11.1.105
GPU models and configuration: GPU 0: Tesla T4
Nvidia driver version: 460.32.03
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.0.5
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.21.6
[pip3] torch==1.12.1+cu113
[pip3] torchaudio==0.12.1+cu113
[pip3] torchsummary==1.5.1
[pip3] torchtext==0.13.1
[pip3] torchvision==0.13.1+cu113
[conda] Could not collect

cc @albanD @mruberry @jbschlosser @walterddr @kshitij12345 @saketh-are
Repository: puppeteer
Issue: [Bug]: Converting page to pdf with puppeteer results in incorrect background size
Labels: bug,upstream,confirmed,P3

### Bug description

Opening this ticket as a follow up to the question asked on Stack Overflow, which did not get any feedback:

https://stackoverflow.com/questions/73859989/converting-page-to-pdf-with-puppeteer-results-in-incorrect-background-size

The issues here is that when saving the web page as a PDF the background image is inconsistent when compared with both the web browser and the saved raster images, in PNG or JPEG formats.

Using the site https://www.netflix.com/notfound as test subject (it just happened to be the one I noticed it on), and the following code:

```ts
function download (src: string, dst: string): void {
  const width = 960;
  const height = 760;
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.setViewport({
      width,
      height,
      deviceScaleFactor: 1,
  });
  await page.goto(`file://${resolve(src)}`);
  const dstSuffix = dst.substring(dst.lastIndexOf('.') + 1, dst.length);
  if (['jpg', 'png', 'gif'].indexOf(dstSuffix) > -1) {
    await page.screenshot({ path: dst });
  } else if ('pdf' === dstSuffix) {
    await page.pdf({
      path: dst,
      width,
      height,
      scale: 1,
      printBackground: true,
      omitBackground: false
    });
  }
  await browser.close();
}
```

Where `src`, is the website URL and  `dst` is the destination local file:

```ts
download('https://www.netflix.com/notfound', 'out.pdf')
```

When outputting as JPG:

![image](https://user-images.githubusercontent.com/682269/193701141-16b8a40d-2975-499c-9f63-ee95206b95e9.png)

and as PDF:

![image](https://user-images.githubusercontent.com/682269/193701204-ac19819d-177a-4614-9f27-dab7fb15403b.png)

Also attaching the test page, in case the live one changes:

[Netflix Error 404 Page.zip](https://github.com/puppeteer/puppeteer/files/9701604/Netflix.Error.404.Page.zip)

### Puppeteer version

18.0.5

### Node.js version

16.6.0

### npm version

8.10.0

### What operating system are you seeing the problem on?

macOS

### Relevant log output

_No response_
Repository: flutter
Issue: [video_player]add integration test for inverted aspect ratio bug on iOS
Labels: platform-ios,p: video_player,P2,team-ios,triaged-ios

The original bug here: https://github.com/flutter/flutter/issues/109116

We need to add integration test to verify the bug fix. However, right now we are having a problem creating the video that can reproduce the bug (more info [here](https://github.com/flutter/flutter/issues/109116#issuecomment-1266185259)).
Repository: go
Issue: cmd/go: go list fails with "no non-test Go files" but succeeds upon re-running
Labels: NeedsInvestigation,GoCommand

While working on an unrelated gopls bug, I stumbled into a scenario where `go list` fails non-deterministically depending on whether GOCACHE is populated.

Test setup: (from x/tools/gopls/internal/regtest/misc.TestImportTestVariant)

```
-- go.mod --
module mod.com

go 1.12
-- client/test/role.go --
package test

import _ "mod.com/client"

type RoleSetup struct{}
-- client/client_role_test.go --
package client_test

import (
	"testing"
	_ "mod.com/client"
	ctest "mod.com/client/test"
)

func TestClient(t *testing.T) {
	_ = ctest.RoleSetup{}
}
-- client/client_test.go --
package client

import "testing"

func TestClient(t *testing.T) {}
```

Notably `client/test/role.go` imports `mod.com/client`, which has no go files (an unintentional bug in the test setup). However, I observed that the entire workspace load fails for gopls in this scenario, due to the following go command bug:

```
$ go clean -cache
$ go list -compiled=true -- mod.com/...
go build mod.com/client: no non-test Go files in /tmp/gopls-regtest-3664541497/TestImportTestVariant/default/work/client
mod.com/client
mod.com/client/test
$ go list -compiled=true -- mod.com/...
mod.com/client
mod.com/client/test
```

The first time the go command runs, it returns a non-zero exit code with the "no non-test Go files" error printed to stderr. The second time, it succeeds with no error.

I see no reason for the error upon the first invocation, but even so the error should of course not depend on the state of the cache.

In my testing, this bug exists at least back to Go 1.12, so it's hard to make an argument for urgency (other than the fact that it just cost me two hours of debugging! :) )

CC @bcmills @adonovan
Repository: godot
Issue: Vulkan: GPU validation errors in VoxelGI
Labels: bug,topic:rendering,topic:3d

### Godot version

4.0 dev 4b52c6caef8a9e5d940ce0977d5c467296ac5805

### System information

Windows 10

### Issue description

Running Calinous tesseract demo, Voxel GI is showing the following validation error if `--gpu-validation` is given:

```
ERROR: VALIDATION - Message Id Number: -564812795 | Message Id Name: VUID-VkDescriptorImageInfo-imageLayout-00344
        Validation Error: [ VUID-VkDescriptorImageInfo-imageLayout-00344 ] Object 0: handle = 0x19e855d8eb0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xde55a405 | vkCmdDispatch: Cannot use VkImage 0x119b090000006291[VoxelGI Instance Texture] (layer=0 mip=0) with 
specific layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL that doesn't match the previous known layout VK_IMAGE_LAYOUT_GENERAL. The Vulkan spec states: imageLayout must match the actual VkImageLayout of each subresource accessible from imageView at the time this descriptor is accessed as defined by the image layout matching rules (https://vulkan.lunarg.com/doc/view/1.2.198.1/windows/1.2-extensions/vkspec.html#VUID-VkDescriptorImageInfo-imageLayout-00344)
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_COMMAND_BUFFER, Handle 1780353961648
```

Code giving this error is in `gi.cpp` line 2974 `RD::get_singleton()->compute_list_dispatch(compute_list, wg_count, 1, 1);`, in method `GI::VoxelGIInstance::update`.



### Steps to reproduce

Run Godot with `--gpu-validation` and use a scene that has a Voxel GI node.

### Minimal reproduction project

https://github.com/Calinou/godot-reflection
Repository: go
Issue: net/http: ErrContentLength not returned for too-long HTTP/2 body writes
Labels: NeedsFix

```
// ErrContentLength is returned by ResponseWriter.Write calls
// when a Handler set a Content-Length response header with a
// declared size and then attempted to write more bytes than
// declared.
ErrContentLength = errors.New("http: wrote more than the declared Content-Length")
```

Writing too many bytes to an HTTP/2 body doesn't return `ErrContentLength`, however, for two reasons:

1. The HTTP/2 `ResponseWriter` returns a different error when detecting a too-long body.
2. The accounting for how many bytes have been written can fail to detect a too-long body until after the `ResponseWriter.Write` call has returned.

The existing test `TestIdentityResponse` fails when run in HTTP/2 mode.
Repository: go
Issue: net/http: TestTransportPersistConnContextLeakMaxConnsPerHost fails in HTTP/2 mode
Labels: NeedsInvestigation

`TestTransportPersistConnContextLeakMaxConnsPerHost` tests that request contexts are eventually garbage collected.

Running this test in HTTP/2 mode (after refactoring to add an HTTP/2 version) results in it failing:

```
$ go test ./net/http -run=ContextLeakMaxConns
--- FAIL: TestTransportPersistConnContextLeakMaxConnsPerHost (0.22s)
    --- FAIL: TestTransportPersistConnContextLeakMaxConnsPerHost/h2 (0.20s)
        transport_test.go:1963: 63 Contexts still not finalized after 100 GC cycles.
```

I'm not sure what's going on, but the test looks correct to me. This might be indicative of a real issue. Or maybe I'm missing something.
Repository: flutter
Issue: Expose ListView velocity when scrolling
Labels: c: new feature,framework,f: scrolling,c: proposal,P3,team-framework,triaged-framework

This was closed, but it would be nice to expose it so people can do what they will with it. All the potential use cases are impossible to predict.
https://github.com/flutter/flutter/issues/26418

As one example use case:
* We want to dismiss the keyboard when a user begins scrolling a list, but we don't want to close it if a list is just passively scrolling.

So we need to tell if the change event was driven by physics, or by the users direct touch.

An easy way to do this is with `velocity`, if it's 0 for 2 updates in a row we know user is dragging:
```dart
  double _prevVel = -1;
  void _handleResultsScrolled() {
    final vel = _controller.position.activity?.velocity;
    if (vel == 0 && _prevVel == 0) {
      FocusManager.instance.primaryFocus?.unfocus();
    }
    _prevVel = vel ?? _prevVel;
  }
```

Then we can do something like this, where the keyboard closes when user initiates scroll, but not when the scroll 'throw' is finishing:

https://user-images.githubusercontent.com/736973/193720604-ef0583e6-985c-4e1f-af77-7872018f9785.mp4
Repository: godot
Issue: Error when setting exported custom resource field to be a new resource
Labels: bug,topic:gdscript,topic:editor,needs testing

___

***Bugsquad note:** This issue has been confirmed several times already. No need to confirm it further.*

___

### Godot version

4.0.beta2

### System information

Ubuntu 20.04

### Issue description

When attempting to set the value of an exported custom resource field of type `TestResource` (extending `Resource`) by using the "New TestResource" option through the editor, the following error is emitted:
```
Failed to set a resource of the type 'Resource' because this EditorResourcePicker only accepts 'TestResource' and its derivatives.
```

### Steps to reproduce

1. Create a custom resource with class name `TestResource` extending `Resource` with a single exported field.
```gdscript
extends Resource
class_name TestResource
@export var field := ''
```
2. Create a custom node type with class name `TestNode` extending `Node` with a single exported field of type `TestResource`.
```gdscript
extends Node
class_name TestNode
@export var node: TestResource
```
4. Create a node of type `TestNode`.
5. Click on the created node. The `Node` field should be `<empty>`.
6. Try to set the `Node` field using the "New TestResource" option. The observed error will be emitted.

### Minimal reproduction project

[resource-test.zip](https://github.com/godotengine/godot/files/9702669/resource-test.zip)
Repository: deno
Issue: WebCrypto CFRG curves tracking issue
Labels: ext/crypto

- [x] #14119 added support for key generation of Ed25519 and X25519 
- [x] #16140 Completes implementation for Ed25519 import/export
- [x] Fix X25519 operations (derive and import JWK) and add tests.
- [ ] Implement Ed448 and X448
Repository: storybook
Issue: Staticdirs is not working on sass files.
Labels: bug,needs triage

I am working on a NextJs project which has public folder as static folder. To make it work on storybook I have added `staticDirs: ["../public"]` array in main.js file and it works for the stories files for example I can call the images like this `/images/logo.png` in stories but it does not work for SASS file for example `/fonts/font1.woff`, it is not able to resolve the path. To make it work I have to add full path including public folder `/public/fonts/font1.woff` but then it stops working for Nodejs.

This is the content of my storybook main.js file:


```
module.exports = {
  stories: ["../components/**/**/*.stories.tsx"],
  addons: [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/addon-interactions",
    "@storybook/preset-scss"
  ],
  framework: "@storybook/react",
  core: {
    builder: "@storybook/builder-webpack5"
  },
  staticDirs: ["../public"]
}
```
Repository: vscode
Issue: Wrong AppData folder
Labels: bug,upstream,windows,electron,confirmation-pending,sandbox

- VS Code Version: 1.71.2
- OS Version: Windows 10 (Version 1909)

VS Code is using the wrong AppData folder with versions after 1.68.

With version 1.68, everything worked fine.
VS Code created AppData Files in the following folder:
\\server\usrprofile$\...\AppData (%APPDATA%)

With version, 1.71.2, VS Code is writing files to the following folder, which is wrong.
C:\usrprofile$\...\AppData

Has there anything changed regarding AppData path?
Repository: go
Issue: net: LookupMX does not consider IP addresses as valid records
Labels: NeedsInvestigation

This is a followup to #46979. I found another case where https://golang.org/cl/322230 broke the original logic. Even though MX records MUST contain domain names, occasionally they contain IP addresses. And this change considers IP addresses as invalid records and returns an error making delivery to respective email service providers impossible. The number of such cases is minuscule in the great schema things, but still we at Mailgun handle a few thousand messages to such email providers per hour. So in the spirit of [Robustness Principal](https://en.wikipedia.org/wiki/Robustness_principle) I believe a change should be made to allow IP addresses in MX records.
Repository: go
Issue: proposal: x/sync/semaphore: Add TryAcquireAll function
Labels: Proposal

# Motivation

I use semaphore to guard a pool of objects. It other words tokens in the semaphore correspond to my items in the pool. The standard acquire function looks like this:
```
func (p*Pool[T]) Acquire(ctx context.Context) (*T, error) {
    err := p.semaphore.Acquire(ctx, 1)
    if err != nil {
        return nil, err
    }
    
    p.mux.Lock()
    defer p.mux.Unlock()
    
    // Pseudo-function abstracting away implementation details of the pool.
    return p.takeOne()
}
``` 

At the same time, I'd love to have a function `AcquireAll` that acquires all available resources in my pool at once. The problem is that because the current number of available resources is represented by the semaphore state (i.e. free semaphore tokens), I don't know how many tokens should I try to acquire from the semaphore.

I for sure can do `semaphore.TryAcquire(1)` in a loop as long as it succeeds, but this would require linear time. Another solution is to call `semaphore.TryAcquire(n)` with `n = 2^k`. By doing this, I could acquire all available tokens in 64 steps (because `int64` has 64 bits). This is better but not yet ideal.

# Proposed solution

Add `TryAcquireAll` function that acquires all available tokens atomically and returns the number of tokens acquired. This allows to implement the `AcquireAll` function from an example above using single call to the semaphore.

Proposed implementation of this method is available here:
- [GitHub](https://github.com/golang/sync/pull/19)
- [Googlesource](https://go-review.googlesource.com/c/sync/+/437613)
Repository: godot
Issue: Left quote ` key returns Unknown label in input map
Labels: bug,topic:input

### Godot version

3.5

### System information

Windows 10

### Issue description

Adding an action and choosing `¬ key returns Unknown as the key description:
![image](https://user-images.githubusercontent.com/16231628/193825042-b738f9d5-0392-4d89-b4ab-cb11f6f68136.png)
If I use Physical Key, it correctly identifies it:
![image](https://user-images.githubusercontent.com/16231628/193825107-fdcda30b-8158-464c-84c0-6769bf7530c4.png)


### Steps to reproduce

- Add an action to the input mapper
- Choose Key and press the `¬ key

### Minimal reproduction project

_No response_
Repository: pytorch
Issue: How to perform unstructured interpolation 
Labels: triaged,module: interpolation

### 🚀 The feature, motivation and pitch

My feature request is very simple, I'm not sure if there already exists some approach or implementation to achieve this functionality.

In scipy, there is scipy.interpolate.NearestNDInterpolator class or scipy.interpolate.LinearNDInterpolator class to achieve unstructured interpolation, i.e., giving a set of sparse points that distribute non-uniformly in the spatial domain and interpolate values at any given points, however, currently torch seems only support simple grid structured interpolation like grid_sample

### Alternatives

I have found some implementation for this in 1d, but not sure if this is very efficient and support GPU, also how to extend it to 2D.

https://github.com/aliutkus/torchinterp1d

### Additional context

_No response_
Repository: stable-diffusion-webui
Issue: Stable Diffusion Meta AITemplate with >= 200% performance increase
Labels: enhancement

AI Template from Meta proposes a 200% or more speedup in image generation.

Presently it is only available for the diffusers library: https://github.com/facebookincubator/AITemplate/tree/main/examples/05_stable_diffusion

![Screenshot_2022-10-04_09-12-03](https://user-images.githubusercontent.com/110263573/193828121-afd41502-84a6-4836-b935-38aa2b307cb0.png)

PT = pytorch, AIT = AI template implementation
Repository: godot
Issue: Input events are duplicated for D-pad buttons on Linux
Labels: bug,platform:linuxbsd,confirmed,topic:input

### Godot version

v3.5.1.stable.mono.official [6fed1ffa3]

### System information

Linux

### Issue description

When pressing or releasing a D-pad button on a controller on Linux, two duplicate `InputEventJoypadButton`s are produced instead of one.

This issue was encountered when using an Xbox 360 controller on Linux, but not when using the same controller on Windows.

### Steps to reproduce

1. Add a script to a node in a scene.
2. Add an `_input` function to that script that prints a message when an `InputEventJoypadButton` is received. For instance:
```gdscript
func _input(event):
	if event is InputEventJoypadButton:
		print(event.device, " ", event.button_index, " ", event.pressed)
```
3. Run the scene and press and hold a D-pad button on a connected controller.
4. Notice that a message is printed for two input events instead of one.
5. Release the button.
6. Notice that a message is printed for two input events instead of one.

### Minimal reproduction project

[ControllerTest.zip](https://github.com/godotengine/godot/files/9707197/ControllerTest.zip)