1. She must have been rich.

2. She cannot have been rich.
3. You should/ought to have come earlier.
4. He may have found the glasses.
5. He might have found the glasses.
(They are all grammatical and talk about the past, right? By the way, what is the difference between #4 and #5?)

6. He will have found the glasses.
7. He shall have found the glases.
8. He can have found the glasses.
(The three sentences are ungrammatical,aren't they? Only 'may' seems to be used with 'have 'p.p.' Is that right?)

6, 7, and 8 are very unconventional! Only 6 is one that might be used.

1-3 are all correct and refer to the past, yes. 4 and 5 have more of the sense of a present perfect (happened and still happening). These are pretty much interchangeable.

1. She must have been rich: This sentence is grammatical and it talks about the past. It indicates a strong belief or certainty that she was rich based on some evidence or logical deduction.

2. She cannot have been rich: This sentence is also grammatical and it talks about the past. It indicates a strong belief or certainty that she was not rich based on some evidence or logical deduction.

3. You should/ought to have come earlier: This sentence is grammatical and it talks about the past. It expresses a recommendation or advice in hindsight, suggesting that the person should have come earlier.

4. He may have found the glasses: This sentence is grammatical and it talks about the past. It indicates a possibility or uncertainty that he found the glasses. The use of "may" suggests that there is a chance of him finding the glasses but it's not certain.

5. He might have found the glasses: This sentence is also grammatical and it talks about the past. It has a similar meaning to sentence 4, indicating a possibility or uncertainty that he found the glasses. "Might" is another way to express the same idea as "may."

Regarding the difference between #4 and #5, there is no significant difference in meaning. Both sentences express the same idea of uncertainty or possibility of him finding the glasses, but they use different modal verbs ("may" vs. "might") to convey that meaning.

6. He will have found the glasses: This sentence is grammatical and it talks about the future perfect tense. It indicates a strong belief or assumption that by a certain point in the future, he will have found the glasses. It suggests that the action of finding the glasses will be completed before a specific future time.

7. He shall have found the glasses: This sentence is also grammatical but uses less common language. It also talks about the future perfect tense, indicating a strong belief or assumption that he will have found the glasses by a certain point in the future.

8. He can have found the glasses: This sentence is grammatically correct but has an unusual usage. It combines the modal verb "can" with the present perfect tense. While it might sound unusual, it can be understood to convey the idea of someone having the capability or opportunity to find the glasses in the past. However, it is not a common way to express this meaning, and it may sound awkward to native English speakers.

In summary, sentences 1-5 are all grammatical and talk about the past, with slight differences in meaning and usage of modal verbs. Sentences 6-8 are also grammatically correct, but sentence 8 has a less common structure.