"In many ways, genre is like an electron: you can't ever pin it down exactly. You can only say it is generally in this location, for part of the time. But really you can't be sure."
The following is an excerpt from Non Metallic Volume 1 (2018):
My current view of genre and sub-genre is simple: I don't believe genre exists. Not as an absolute. A novel which takes place in a particular setting, like South Dakota in the 1880s, can be found under any bookstore genre. It could be a western, or a hyphenated western-fantasy, or western-romance, or maybe a slashed genre like literary/women's fiction. Alternatively, the novel could be set on Mars in 2056 but adopt all the motifs of a western. It depends on where the author shines her spotlight.
A book by Kurt Vonnegut that features time-travel is not science fiction. For him, time-travel is a device with which he can alter the narrative structure (and maybe, the short non-linear scenes matched his writing style of making each page perfect before moving to the next one). A book by Vernor Vinge that features the exact same time-travel technology, will absolutely be science fiction. He will explain to you how it works. He will develop a societal response to the technology. He will be wondrously thorough. So they're starting with the same lumber, but building different things. Vonnegut builds an ornate cuckoo-clock, Vinge a museum of anthropology.
Instead we can say that genre exists as the expectation of the reader, prior to reading the book. Genre expectation is derived from everything about the book: The font on the cover, the cover art, the author's name, how the book was located by the reader, the theme, the gender of the main character, the setting, the percentage of dialog vs. head-butting, and everything else, will influence this expectation.
In many ways, genre is like an electron: you can't ever pin it down exactly. You can only say it is generally in this location, for part of the time. But really you can't be sure.