sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: [RFC] Should DDP support custom reduction logic for registered module buffers?
Labels: oncall: distributed,triaged,module: ddp

## 🚀 Feature
Support custom logic (i.e. collective reduction) for registered module buffers as part of DDP training. Currently, when buffers are registered as part of a model, DDP will broadcast them from rank 0 or do nothing if `self.broadcast_buffers=False`. However, we have seen some use cases (such as [here](https://discuss.pytorch.org/t/how-to-prevent-some-buffers-from-being-broadcasted-while-having-broadcast-buffers-true/128957)), as well as a request internally where `broadcast` is not sufficient and user would like to have more control over the reduction.

## Motivation

The main motivation is that users would like to register certain tensors as buffers so that they are saved as part of `state_dict` to be a part of model checkpoint, but semantically `broadcast` doesn't make sense for these buffers. One example is tracking the no. of positive/negative examples a rank has seen and using that in computing a weighted loss, where we may want to `allreduce` this ratio instead of broadcasting rank 0's.

## Pitch

@pritamdamania87 brought up an idea for a communication hook (similar to existing gradient communication hooks) that allow users to specify custom buffer reductions. It will default to `broadcast` to maintain compatibility with the current version. Because different buffers may require different reduction, it may have to be a per-buffer lambda specified by the user. A rough sketch of how this can work:

```
class MyModel():
    def __init__(self):
        self.my_buf = register_buffer(...)

ddp = DDP(MyModel())
ddp.register_buffer_comm_hook(ddp.my_buf, lambda buf: dist.all_reduce(buf))

def register_buffer_comm_hook(self, buf, fn):
    assert buf in self.buffers()
    self._buffer_hooks[buf] = fn

def _sync_params(self):
    # default to broadcast_coalesced if _buffer_hooks is empty
    for buf in self.modules_buffers:
        self._buffer_hooks.get(buf, lambda buf: dist.broadcast(buf, 0))(buf)
```

## Performance consideration
We currently coalesce all buffers and broadcast them instead of broadcasting them individually, which reduces the no. of collective comms. we launch and allows us to do it all in one go. With these sort of custom hooks, it is unlikely we will be able to do such a coalesced operation because each buffer could have different reduction logic, which might impact the performance if user chooses to use this feature.

## Alternatives

Instead of hooks which gives more control, it might be simpler to offer setting a strategy on how to reduce each buffer, such as `broadcast`, `allreduce`, etc. This may be simpler but is less configurable.

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @agolynski @SciPioneer @H-Huang @mrzzd @cbalioglu @gcramer23
Repository: flutter
Issue: integration_test has lint issues for older targets
Labels: a: tests,platform-android,f: integration_test,P2,team-android,triaged-android

I'm trying to enable linting of Android native code in flutter/plugins, and ran into the following issue in essentially every plugin:

```
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':integration_test:lintDebug'.
> Lint found errors in the project; aborting build.
  
  Fix the issues identified by lint, or add the following to your build script to proceed with errors:
  ...
  android {
      lintOptions {
          abortOnError false
      }
  }
  ...
  
  Errors found:
  
  [...]/packages/integration_test/android/src/main/java/dev/flutter/plugins/integration_test/FlutterTestRunner.java:40: Error: Multi-catch with these reflection exceptions requires API level 19 (current min is 16) because they get compiled to the common but new super type ReflectiveOperationException. As a workaround either create individual catch statements, or catch Exception. [NewApi]
          } catch (InstantiationException | IllegalAccessException e) {
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

AFAICT because it's coming from integration_test I can't suppress it with a baseline file (since that's per-module). I'm still looking into whether there are other ways I can bypass just this error for now, but it's something could affect 3P plugins as well. We should ideally fix it in integration_test (especially since it sounds like it's an actual issue in the implementation).

/cc @blasten
Repository: rust
Issue: Diagnostics incorrectly suggest `?Sized` on the wrong bound for some trait methods
Labels: A-diagnostics,T-compiler

Given the following code: https://godbolt.org/z/rzr5We5Px

```rust
trait Tr1<'a> {}
trait Tr2 {}
impl<T> Tr1<'_> for T {}
impl<T> Tr2 for T {}

trait Foo: Sized {
    fn foo<'a, T: Tr1<'a>, U: Tr2>(x: &mut T, y: &U) -> Self;
}

fn bar<F: Foo>() {
    let mut x = 1;
    let x = &mut x as &mut dyn Tr1;
    F::foo(x, &2);
}
```

The current output is:

```rust
error[E0277]: the size for values of type `dyn Tr1<'_>` cannot be known at compilation time
  --> <source>:13:5
   |
7  |     fn foo<'a, T: Tr1<'a>, U: Tr2>(x: &mut T, y: &U) -> Self;
   |                            - required by this bound in `Foo::foo`
...
13 |     F::foo(x, &2);
   |     ^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `dyn Tr1<'_>`
help: consider relaxing the implicit `Sized` restriction
   |
7  |     fn foo<'a, T: Tr1<'a>, U: Tr2 + ?Sized>(x: &mut T, y: &U) -> Self;
   |                                   ^^^^^^^^
```

Note that in spite of referring to `Tr1` as the problematic type, all spans refer to `Tr2`. This only occurs for trait methods.
Repository: flutter
Issue: Updating GPU driver while flutter app is being launch causes Could not make the context current to acquire the frame.
Labels: engine,e: gpu driver bug,a: desktop,has reproducible steps,P3,found in release: 2.2,team-windows,triaged-windows

If i launch flutter app, then update GPU driver and return to the app - it freezes and spams error messages in the console.
![AQAQLPk](https://user-images.githubusercontent.com/63228361/128937322-eefc7673-f79c-4601-b41f-73ecdf36467f.png)

Flutter version: 2.2.3 from stable channel
Repository: rust
Issue: Variable remains borrowed after match despite neither arm resulting that way
Labels: A-borrow-checker,T-compiler,C-bug,fixed-by-polonius

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.
-->

I tried this code:

```rust
struct Node {
    next: Option<&'static mut Node>,
}

fn errors(mut node: &mut Node) {
    match &mut node.next {
        Some(next) => {
            node = next
        },
        None => {},
    }
    &mut *node;
}
```

Compiling it gives the following error:
```
error[E0499]: cannot borrow `*node` as mutable more than once at a time
  --> src/lib.rs:12:5
   |
5  | fn errors(mut node: &mut Node) {
   |                     - let's call the lifetime of this reference `'1`
6  |     match &mut node.next {
   |           -------------- first mutable borrow occurs here
7  |         Some(next) => {
   |              ---- assignment requires that `node.next` is borrowed for `'1`
...
12 |     &mut *node;
   |     ^^^^^^^^^^ second mutable borrow occurs here
```

If I add an early return to the `Some` branch, it still errors:

```rust
fn still_errors(mut node: &mut Node) {
    match &mut node.next {
        Some(next) => {
            node = next;
            return
        },
        None => {},
    }
    &mut *node;
}
```

However if I add an early return to the `None` branch, it compiles:
```rust
fn compiles(mut node: &mut Node) {
    match &mut node.next {
        Some(next) => {
            node = next
        },
        None => return,
    }
    &mut *node;
}
```

Also, if I change it to use an `if`, it compiles:
```rust
fn also_compiles(mut node: &mut Node) {
    if node.next.is_some() {
        node = &mut *node.next.as_mut().unwrap()
    }
    &mut *node;
}
```

I would expect all four versions to compile since the third version compiles.

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

Occurs on the rust playground on stable 1.54.0, beta 1.55.0-beta.3 (2021-07-31 53fd98ca776cb875bc9e), and 1.56.0-nightly (2021-08-09 ae90dcf0207c57c3034f)
Repository: flutter
Issue: Remove Android lint-baseline.xml files from flutter/packages
Labels: team,platform-android,package,P2,team-android,triaged-android

In https://github.com/flutter/plugins/pull/4206 we are turning on Android linting, but it does not attempt to fix existing issues. Instead, all existing issues have been codified into lint-baseline.xml so that any new issues will be caught by CI.

We should go plugin by plugin and fix (or explicitly disable in a targetted way) all of the issues, and remove both lint-baseline.xml, and the corresponding `baseline file("lint-baseline.xml")` from build.gradle.

The plugins to be cleaned up are:
- [x] camera_android - https://github.com/flutter/packages/pull/3716, https://github.com/flutter/packages/pull/3993
- [x] camera_android_camerax - https://github.com/flutter/packages/pull/3966
- [ ] espresso
- [x] flutter_plugin_android_lifecycle - https://github.com/flutter/packages/pull/4030
- [x] google_maps_flutter_android - https://github.com/flutter/packages/pull/3751
- [x] google_sign_in_android - https://github.com/flutter/packages/pull/3762
- [x] image_picker_android - https://github.com/flutter/packages/pull/3887
- [x] in_app_purchase_android - https://github.com/flutter/packages/pull/4032
- [x] local_auth_android - https://github.com/flutter/packages/pull/3764
- [x] path_provider_android - https://github.com/flutter/packages/pull/3706
- [x] quick_actions_android - https://github.com/flutter/packages/pull/3885
- [x] shared_preferences_android - https://github.com/flutter/packages/pull/3707
- [x] url_launcher_android - https://github.com/flutter/packages/pull/3690
- [x] video_player_android - https://github.com/flutter/packages/pull/3886
- [x] webview_flutter_android - https://github.com/flutter/packages/pull/3675

[Edit: Updated the list with more plugins since https://github.com/flutter/packages/pull/3648 adds more baseline files]
Repository: vscode
Issue: With Webview, editor doesn't get focused when clicking the text area of the editor
Labels: bug,webview

Version: 1.60.0-insider
Commit: 71b299184f7908491345aec5e231599c3ae8753b
Date: 2021-08-10T05:14:25.271Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 18.7.0

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

1. Open a markdown file.
2. Open a markdown preview.
3. Click the preview.
4. Click other window. VS Code gets unfocused.
5. Click the text area of the markdown file on VS Code. The tab of the editor is still gray-out.


https://user-images.githubusercontent.com/10665499/128951016-141f8128-6d66-4bca-a405-b482c3095a9d.mov
Repository: pytorch
Issue: Find out why TestSparseCPU.test_softmax_cpu_float64 grad and input dtypes are different
Labels: triaged,module: structured kernels

In #62372 (structured kernel port for `log_softmax_backward_data`, some error checking code could not be moved into the meta function because the CPU version of this kernel allows `input` and `grad` to have different dtypes. The only dtype conversion I can see in the `{log}_softmax{_backward_data}` kernels is half to float conversion that is only supported by the CUDA implementation of `{log}_softmax`.

The goal of this task is to find out why the `grad` and `input` dtypes in the test mentioned in the title are different and make them the same if possible. Then, the `TORCH_CHECK` in the CUDA versions of `{log}_softmax_backward_data` can be moved to their respective metas.

[See this comment thread for more context](https://github.com/pytorch/pytorch/pull/62372/files#r684519454).

cc: @ezyang
Repository: deno
Issue: deno test --doc does not handle escaped code block correctly
Labels: bug,testing

Minimal markdown `foo.md` extracted from `deno_std/io/README.md`
~~~
````
```ts
````


````
```ts
##
````
~~~
Run `deno test --doc`

Expected:
```
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (0ms)
```
Received:
```
error: Unexpected token `#`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier at file:///home/yuan/Documents/test/foo.md$7-10.ts:1:0
```
Repository: go
Issue: x/net/http2: Server rejects Transport with ErrCodeProtocol stream error
Labels: NeedsInvestigation

We're running a Go 1.17rc2 httputil.ReverseProxy in front of a Go go1.17rc2 net/http.Server.

We were seeing weird ErrCodeProtocol stream errors, so we stopped using the bundled x/net/http2 and switched both to using x/net/http2 explicitly (with http2.ConfigureTransports and http2.ConfigureServer, so the bundled one isn't used).

Our x/net git version is https://github.com/golang/net/commit/aaa1db679c0d7765d2b1cb1f92cac8ebf4d94c53, which is today's current master.

The logs we were getting weren't initially enough to tell us where the problem was:

```
2021/08/10 14:07:20 http: proxy error: stream error: stream ID 1293155; PROTOCOL_ERROR
2021/08/10 14:07:20 http: proxy error: stream error: stream ID 1293157; PROTOCOL_ERROR
```

But after hacking it up locally to add some expvar counters on which paths in http2.Server were returning the protocol error, we found it was here:

https://github.com/golang/net/blob/aaa1db679c0d7765d2b1cb1f92cac8ebf4d94c53/http2/server.go#L1835
```go
// http://tools.ietf.org/html/rfc7540#section-5.1.2
// [...] Endpoints MUST NOT exceed the limit set by their peer. An
// endpoint that receives a HEADERS frame that causes their
// advertised concurrent stream limit to be exceeded MUST treat
// this as a stream error (Section 5.4.2) of type PROTOCOL_ERROR
// or REFUSED_STREAM.
if sc.curClientStreams+1 > sc.advMaxStreams {
        if sc.unackedSettings == 0 {
                // They should know better.
                return streamError(id, ErrCodeProtocol)
        }
```

So, the Go http2 client (Transport) and/or server is getting its concurrent/max streams accounting wrong.

Perhaps interesting: the backend (the http2.Server that the ReverseProxy's Transport is hitting) has extremely long-running http.Handlers (like: days or weeks longs) alongside many short ones. That might explain why this bug hasn't been reported by more people.

I see no recent commits that suggest this is a regression. This server is new, so I also can't say whether it worked previously.

/cc @neild @bcmills @fraenkel @dmitshur @dsnet @josharian
Repository: go
Issue: x/tools/gopls: track uses with fillreturns adding error returns
Labels: FeatureRequest,gopls,Tools

Fillreturns uses any in-scope variables when they match the type, but this doesn't work well with error returns.
An example of this is found in https://www.youtube.com/watch?v=6r08zGi38Tk around the 11:20 mark. The `err` return variable has already been used in an earlier return statement, but we still return it again below. It would be nice to check that it had already been used and use `nil` instead.
Repository: godot
Issue: Overriding GraphNode theme icons displays pitch black textures
Labels: bug,topic:gui

### Godot version

3.3.2 and 3.4.beta

### System information

Windows 10, GTS 450

### Issue description

Tried to override **graphnode** theme icon and here you go, black texture instead close button.

![Безымянный](https://user-images.githubusercontent.com/36783322/128980724-2383a7ad-efb2-4ced-9e15-cab1499932b4.png)

that happens with resizer and port too.

### Steps to reproduce

1. open attachment
2. try to change theme override -> any icon.

### Minimal reproduction project

[New Game Project.zip](https://github.com/godotengine/godot/files/6966340/New.Game.Project.zip)
Repository: storybook
Issue: Object Args from query do not overwrite story params
Labels: bug,needs triage

**Describe the bug**
When providing object args in query params, they seems not to be applied to story. 

**To Reproduce**
Open page: https://storybookjs.netlify.app/official-storybook/?path=/story/@storybook/design-system_avatarlist--basic&args=users[0].name:Lorem+ipsum. Notice `users[0].name` should be set to `Lorem ipsum`, but it's not. This param is not passed to story. The first user is still `Dominic Nguyen`.

Issue is also reproducible using next version. https://next--storybookjs.netlify.app/official-storybook/?path=/story/@storybook/design-system_avatarlist--basic&args=users[0].name:Lorem+ipsum

**System**
```
Environment Info:

  System:
    OS: macOS 11.5.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 14.14.0 - /usr/local/bin/node
    Yarn: 1.19.1 - ~/.npm-global/bin/yarn
    npm: 6.14.8 - /usr/local/bin/npm
  Browsers:
    Chrome: 92.0.4515.131
    Firefox: 88.0.1
    Safari: 14.1.2
```
Repository: create-react-app
Issue: Cannot access dev server over IPv6
Labels: needs triage,issue: bug report

### Describe the bug

The Webpack dev server does not properly handle IPv6 requests. It responds with `Cannot GET /`.

### Did you try recovering your dependencies?

I don't use multiple package managers

### Which terms did you search for in User Guide?

`ipv6`, `ipv4`

### Environment

```
Environment Info:

  current version of create-react-app: 4.0.3
  running from /home/logandark/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app

  System:
    OS: Linux 4.4 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
  Binaries:
    Node: 16.4.0 - ~/.nvm/versions/node/v16.4.0/bin/node
    Yarn: Not Found
    npm: 7.18.1 - ~/.nvm/versions/node/v16.4.0/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    react: ^17.0.2 => 17.0.2
    react-dom: ^17.0.2 => 17.0.2
    react-scripts: 4.0.3 => 4.0.3
  npmGlobalPackages:
    create-react-app: Not Found
```

(WSL 1 on Windows 10 Home 2004 build 19041.928)

### Steps to reproduce

1. `npm start`
2. Try to connect to `[::1]:3000`
3. Observe `Cannot GET /`
4. Try to connect to `127.0.0.1:3000` (`localhost` will no longer work as your browser will try to connect over IPv6)
5. Works

**After trying this just once, or perhaps after using `localhost` normally for a while, your browser will "helpfully" notice that `localhost` has an IPv6 equivalent, and switch to it permanently, requiring you to explicitly use `127.0.0.1` if you want to actually connect to the server.** This will cause development tools to complain about insecure HTTP because they think they are connecting to an external IP address.

### Expected behavior

App shows up normally over IPv6

### Actual behavior

`Cannot GET /`
Repository: react-native
Issue: [a11y] Accessibility for nested text components
Labels: Component: Text,Accessibility,Needs: Attention,Accessibility Team - Evaluated

## Description
Same as (stale) https://github.com/facebook/react-native/issues/27147. 
Consider this example:
```
<Text>
    <Text> Please click:  </Text>
    <Text accessible={true} accessibilityRole='link' onPress={openLink()}> Link </Text>
</Text>
```

A screen reader user is not able to click/open the link (i.e. the 2nd nested Text component). Ideally, the screen reader should focus on the link as well. The addition of any permutation of accessibility props on the parent/child Text component does not help.

## React Native version:
**React native 0.62.**
React Native Environment Info:
    System:
      OS: Windows 10
      CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
      Memory: 19.72 GB / 31.92 GB
    Binaries:
      Node: 12.21.0 - C:\Users\supsing\AppData\Local\Temp\yarn--1628676998345-0.3639484914346074\node.CMD
      Yarn: 1.22.10 - C:\Users\supsing\AppData\Local\Temp\yarn--1628676998345-0.3639484914346074\yarn.CMD
      npm: 6.14.11 - C:\Users\supsing\AppData\Local\nvs\default\npm.CMD
      Watchman: 20210102.202219.0 - E:\watchman-v2021.01.04.00-windows\bin\watchman.EXE

## Steps To Reproduce
Write nested text components as shown in the description.

## Expected Results
Screen reader (Voiceover/talkback) should be able to tell the user that there is a link and user should be able to click on that link.

In Android (native), talkback adds any links available in a single text view in the accessibility menu (can be opened using swipe up then swipe right). The same should be done by React Native as well. Perhaps it can be achieved with ClickableSpan in Android. There should be similar ways in iOS as well.
## Snack, code example, screenshot, or link to a repository:
```
<Text>
    <Text> Please click:  </Text>
    <Text accessible={true} accessibilityRole='link' onPress={openLink()}> Link </Text>
</Text>
```
Repository: TypeScript
Issue: Mapped Type + Recursive Type = Type instantiation is excessively deep and possibly infinite (2589)
Labels: Bug

# Bug Report

This is the simplest repro of an issue that prevents the use of recursive mapped types for any type that contain any properties (or properties of properties etc...) typed using a recursive type alias.

### 🔎 Search Terms

* Type Alias
* Mapped Types
* Recursive Types
* Type instantiation is excessively deep and possibly infinite

### 🕗 Version & Regression Information

Since 3.7

### ⏯ Playground Link

[Playground Link](https://www.typescriptlang.org/play?#code/C4TwDgpgBAShDGBXATgZwJYDcIBVzQF4pVhl0A7AcygB8pzEBbAIwmVtgRQ2z0gG0AugG4AUKNCQoAWQCGYSABM+EADw4AfFCIBvUVCj8A0lApQA1hBAB7AGZQcggFwz5SleuOCNYgL5iJfFcFCGV8AHlbOCQ0LFwgojkQsMhVaO44lR9RIA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
type RecursiveType = string | number | RecursiveType[];

type MappedType<T> = {
  [K in keyof T]: MappedType<T[K]>;
};

type MappedTypeOfRecursiveType = MappedType<RecursiveType>;
```

### 🙁 Actual behavior

Type instantiation is excessively deep and possibly infinite. (2589)

### 🙂 Expected behavior

Expected to compile successfully